Fixing Form Error

Unified

Registered User.
Local time
Yesterday, 17:23
Joined
Aug 26, 2004
Messages
18
Can anyone tell me how to clear up the error I get when i click on any record in the ListBox? The reason the code is like it is, is because I was following an example database. When you click on a record, it is supposed to populate the corresponding ComboBox with the data, but with the way i have it, when a record is clicked an error pops up. Thanks in advance!
 

Attachments

The reason it is not working is the reference to the Microsoft DAO 3.6 Object Library is missing. Here are some steps you can try.

1. Go to your Database:Modules
2. If no module exists click on New.
3. Once the module page loads, click on Tools.
4. Click on references.
5. Check and see if Microsoft DAO 3.6 Object Library has a check box. If it doesn't, you will need to put one.
6. Click ok and then exit the VB Module Window.

Go back to your form and give it a try.
 
r3df1sh said:
The reason it is not working is the reference to the Microsoft DAO 3.6 Object Library is missing. Here are some steps you can try.

1. Go to your Database:Modules
2. If no module exists click on New.
3. Once the module page loads, click on Tools.
4. Click on references.
5. Check and see if Microsoft DAO 3.6 Object Library has a check box. If it doesn't, you will need to put one.
6. Click ok and then exit the VB Module Window.

Go back to your form and give it a try.

Alright, the check box didn't have a check, so I fixed that. But now i get a different error. When I click on a record, a window pops up that says "Run-Time Error '3464': Data type mismatch in criteria expression" with buttons that say "End" and "Debug". When I click on Debug, it points to the line in my code that says "rs.FindFirst "[JobID] = " & Str(Me![lbDisplay])"

*Edit*
Here's the code for the ListBox I have:

Code:
Private Sub lbDisplay_AfterUpdate()
 
    Dim db As DAO.Database
    Dim rs As DAO.Recordset
      
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[JobID] = " & Str(Me![lbDisplay])
    Me.Bookmark = rs.Bookmark
    
End Sub
 
Last edited:

Users who are viewing this thread

Back
Top Bottom