Wrox Programmer Forums
|
BOOK: Access 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2003 VBA Programmer's Reference by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein; ISBN: 9780764559037
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2003 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2006, 05:07 PM
Registered User
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default DAO and seek

I have two questions in regards to the below example that can be found on page 170.

1. On the second to last line it says 'rs.CustName'. Now where does rs come from and what does it mean? Is it a misspelling of 'rst'??
2. I assume that CustName is a name of one of the fields in the table. I get an error message when I try to separate the recordset and a field with a dot (rst.CustomerId) but it works if I use an exclamation mark (rst!CustomerId). Why is this? I cant see what i am doing different that what they are doing in the book.

Help will be very appreciated!

Example:

'Open the database that contains the table that is linked
Set dbs = OpenDatabase(strMyExternalDatabase)
'Open a table-type recordset against the external table
Set rst = dbs.OpenRecordset("tblCustomers", dbOpenTable)
'Specify which index to search on
rst.Index = "CustomerNo"
'Specify the criteria
rst.Seek "=", 123
'Check the result
If rst.NoMatch Then
MsgBox "Record not found."
Else
MsgBox "Customer name: " & rs.CustName
End If

 
Old March 15th, 2006, 06:02 PM
Authorized User
 
Join Date: May 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

no i dont think that it is a misspelling. the but of this code is to show you how to use the rst.seek
somehow, there is no declaration for the Objects but i suppose that rs is another recordset and the rst is temporarily used for your search.
we wait for the reply from the expert






Similar Threads
Thread Thread Starter Forum Replies Last Post
seek a expression petergoodman XSLT 3 July 16th, 2008 01:45 AM
Seek Time... ankur_icfai SQL Server 2000 2 August 30th, 2006 11:14 PM
cannot 'seek' inside a function dextermagnific XSLT 2 August 10th, 2006 01:54 AM
How to use seek method in DAO nadee VB How-To 4 April 21st, 2006 10:55 AM
Seek record in Access sunny76 Access 3 February 21st, 2006 09:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.