Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Acccess 97 Button Grid

Author  Topic 

nadtopia
Starting Member

1 Post

Posted - 2002-03-07 : 06:31:28
I am having trouble retieveing 144 records from a table in Access 97 using a query, the problem is that I am returning one record at a time and using that returned record to update a caption of a toggle button. There are 144 captions to update each being updated after the four parameters of the query are assigned

so the steps are:
1) First setup the objects...
Set db = CurrentDb
Set qdf = db.QueryDefs("qryUpdateToggleButtons")

2) look for a control which is a toggle button
3) if it is a toggle button then fill in the parameters for the query

qdf.Parameters(0) = strTGWhatCAN
qdf.Parameters(1) = strTGWhatTANK
qdf.Parameters(2) = adhCtlTagGetItem(ctlWhatControl, "Cane")
qdf.Parameters(3) = adhCtlTagGetItem(ctlWhatControl, "Vial")

4) Open the recordset up so that we have the data in the rs

Set rst = qdf.OpenRecordset(, dbOpenSnapshot)

5) Check for Null values
6) Update the Captions

The above is done 144 times...

so you see it takes time...

Hellllp...

Nadeem


robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-03-07 : 07:47:34
If all 144 captions are kept in the same table, why not have the query return them all as one recordset, then use MoveNext to access all of the captions? You would only need to open the recordset once.

Without more information on your table structures, form design, and the code you're using this is the best suggestion I can make.

Go to Top of Page
   

- Advertisement -