SteveL13
asked on
Checkbox true if criteria exists
I have a checkbox on a form named chkbxCurrentCustomer.
I need code in the oncurrent event of the form to check the checkbox true if the contents of the field "FullName" exists in a field named "FullName" in tblCustomers.
Otherwise it should be false.
How can I do this?
I need code in the oncurrent event of the form to check the checkbox true if the contents of the field "FullName" exists in a field named "FullName" in tblCustomers.
Otherwise it should be false.
How can I do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could use something like:
Private Sub Form_Current:
if me.[FullName] & "" = "" Then
me.chkbxCurrentCustomer = false
elseif DCOUNT("*", "tblCustomers", "[FullName] = '" & me.[FullName] & "'") > 0 Then
me.chkbxCurrentCustomer = true
Else
me.chkbxCurrentCustomer = false
End If
End Sub