Retreiving Values from a Table

G

Guest

My app is hanging up after the last line below. How do I retrieve the value
for 'BlockUser' in table 'tblBlockuser' in the database 'LogKeeper'? I'm
using Access 2002 SP3. The database is located on a LAN server.

Dim MyDB As DAO.Database
Dim MyRS As DAO.Recordset
Set MyDB = CurrentDb()
Set MyRS = MyDB.OpenRecordset("tblBlockuser")

If MyRS!blockuser = True Then
 
B

Brendan Reynolds

If this code is running in the database 'LogKeeper', or in a database that
has a link to the table 'tblBlockuser' in that database, then it will
retrieve all fields in all records from that table. There is a potential
issue in that it will retrieve those records in no specific order, so when
you refer to 'MyRS!blockuser' you are referring to the value of the field in
an unspecified record, which is probably not what you want, but I don't see
anything here that should cause Access to hang.

Is the field 'blockuser' a Boolean (Yes/No) field? What's the next line of
code? When you say 'hang' to you mean that the app stops responding, or does
anything else happen?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top