PDA

Click to See Complete Forum and Search --> : FindFirst produces error


Rob Brown
May 23rd, 2000, 04:22 PM
Hi.

I am building a VB5 front end for an Access 97 database. I am using the following code to find the current user (placed in a public string at logon) in a table in the database.

Private Sub Form_Load()

Dim strFind As String

strFind = "Username = '" & frmLogon.strCurrentUser & "'"

dtaChangePassword.Recordset.FindFirst strFind

End Sub

At run-time it produces the following error:

Object variable or with block variable not set.

Does anyone know what I am doing wrong?

Any help would be much appreciated.

Best Regards,

Rob Brown.

Chris
May 24th, 2000, 12:55 PM
Hi Rob Brown,

Do you open the recordset before you use the FindFirst method?