SOS with this VBA

icemonster

Registered User.
Local time
Today, 16:35
Joined
Jan 30, 2010
Messages
502
Code:
If Not IsNull(Me.lst3month.Column(0)) Then
    DoCmd.OpenForm "frmReviewDetails3MONTHS", , , "EMPLOYEEREVIEWID = " & Me.lst3month
Else
    DoCmd.OpenForm "frmReviewDetails3MONTHS", , , "EMPLOYEEID = " & Me.lst3month
End If
End Sub

keeps giving me a missing operator on the "DoCmd.OpenForm "frmReviewDetails3MONTHS", , , "EMPLOYEEREVIEWID = " & Me.lst3month" line.

all i want is to open a record using a filter if the listbox row 0 is null, am i doing this right at all?
 
What data is Me.lst3month?
The error points to this being the problem.
 
me.lst3month is a listbox,

basically, what is the best way to open a form using two different criteria with a listbox?
 
What I meant was what datatype e.g. text, date, number etc.

If text then you will need to add quotes like this:

..."EMPLOYEEREVIEWID = '" & Me.lst3month & "'"
 
I would hardwrite the code using a number you kno should work i.e.
..."EMPLOYEEREVIEWID = 6"

I would also try putting a breakpoint on the event trigger and step through the code a line at a time and see exactly what is going on.
 
I think it should be this.


"EMPLOYEEREVIEWID = " & Me.lst3month & "



-Gregg
 

Users who are viewing this thread

Back
Top Bottom