Convert code VBA to expression in query (1 Viewer)

azhar2006

Registered User.
Local time
Today, 10:43
Joined
Feb 8, 2012
Messages
202
Hello friends again
I need help converting this code from VBA to an expression in a query. I've tried hard and failed to turn it into an expression.
Code:
If Not IsNull(Me.txtsucc) Then
        strWhere = strWhere & "([Success] = """ & Me.txtsucc & """) AND "
End If
Thank you very much
 

plog

Banishment Pending
Local time
Today, 12:43
Joined
May 11, 2011
Messages
11,646
Me won't work in a query, so you need the full path to txtsucc. Then it would look like this:

...WHERE (([Success]=[Forms]![YourForm]![txtsucc]) OR ([Forms]![YourForm]![txtsucc] IS NULL))...
 

azhar2006

Registered User.
Local time
Today, 10:43
Joined
Feb 8, 2012
Messages
202
Me won't work in a query, so you need the full path to txtsucc. Then it would look like this:

...WHERE (([Success]=[Forms]![YourForm]![txtsucc]) OR ([Forms]![YourForm]![txtsucc] IS NULL))...
IIf(IsNull([Forms]![frmMastr]![txtsucc]);[Success];[Forms]![frmMastr]![txtsucc])
 

Users who are viewing this thread

Top Bottom