Hello I wish to check to see if a record exists in a table (to help stop a further record being created).
I have a table called tbl_Applicant. In this are fields App_Status and App_Property_ID_Link
I want to check from an unbound form whether a record exists in tbl_Applicant which has status 'Current' and a App_Property_ID_Link of say 500 (the App_Property_ID_Link will be from a textbox on the form called txt_App_Property_ID_Link).
I have the following working seperately, but can not figure out how to combine the two. Or is there a better way?
Many thanks Mark
I have a table called tbl_Applicant. In this are fields App_Status and App_Property_ID_Link
I want to check from an unbound form whether a record exists in tbl_Applicant which has status 'Current' and a App_Property_ID_Link of say 500 (the App_Property_ID_Link will be from a textbox on the form called txt_App_Property_ID_Link).
I have the following working seperately, but can not figure out how to combine the two. Or is there a better way?
Code:
If DCount("[App_Status]", "tbl_Applicant", "[App_Status] = 'current' ") > 0 Then
MsgBox "found"
Else
MsgBox "not found"
End If
Code:
If DCount("[App_Property_ID_Link]", "tbl_Applicant", "[App_Property_ID_Link] = " & [txt_App_Property_ID_Link]) > 0 Then
MsgBox "found"
Else
MsgBox "not found"
End If
Many thanks Mark