If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: help with search button to disable another command button

I have a search button programmed and would like to have a button called "cmdeditcustomer" be disabled if no records match the search criteria. I am unsure of what code needs to be written and where it needs to be I know the simple line of code "me.cmdeditcustomer.enabled = false" does the trick but I also know that I would need some sort of a conditional statement for this to work. Here is my code for the search button, I am using Access 07.

Dim strWhere As String
Dim lnglen As Long

If Not IsNull(Me.srchtxtlastname) Then
strWhere = strWhere & "([Lastname] = """ & Me!srchtxtlastname & """) AND "
End If

If Not IsNull(Me.srchtxtfirstname) Then
strWhere = strWhere & "([Firstname] = """ & Me!srchtxtfirstname & """) AND "
End If

If Not IsNull(Me.srchtxtemail) Then
strWhere = strWhere & "([Email] = """ & Me!srchtxtemail & """) AND "
End If