Retreiving Values from a Table

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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?
 
Back
Top