icemonster
Registered User.
- Local time
- Today, 16:47
- Joined
- Jan 30, 2010
- Messages
- 502
can someone tell me what needs to be changed here.
basically, what i want is, if the form is opened through the listbox, it would filter the clientID through the listbox, but if the form is a new record, the sql statement would then be filtered using the forms clientid, here's the code.
basically, what i want is, if the form is opened through the listbox, it would filter the clientID through the listbox, but if the form is a new record, the sql statement would then be filtered using the forms clientid, here's the code.
Code:
If Not IsNull(Forms![frmMainMenu]![lstPatients]) Then
lngClientID = Forms![frmMainMenu]![lstPatients]
'determine if there is any existing value in the "strwheresql" variable
strWhereSql = "Where qryClientStatusList1.CSCLIENTID = " & lngClientID & " "
Else
strWhereSql = ""
End If
If Not IsNull(Forms![frmClientDetails1]![txtClientID]) Then
lngClientID2 = Forms![frmClientDetails1]![txtClientID]
If strWhereSql = "" Then
strWhereSql = "Where qryClientStatusList1.CSCLIENTID = " & lngClientID2 & " "
Else
strWhereSql = strWhereSql & "And qryClientStatusList1.CSCLIENTID = " & lngClientID2 & " "
End If
End If