J
Jeff
Hi,
I have a page to let user type in a"key" and search my database. Then
another page is opened to display the result. My code is as follow:
Private Sub btnSearch_Click()
On Error GoTo Err_btnSearch_Click
Dim strSQL As String
strSQL = "[tbPatient].[Name]=Forms![frmSearch].[Name]"
DoCmd.OpenForm "frmSearchResult", , , strSQL
Exit_btnSearch_Click:
Exit Sub
Err_btnSearch_Click:
MsgBox Err.Description
Resume Exit_btnSearch_Click
End Sub
My problem is when no record is found after search, the display page
"frmSearchResult" seems to partly open. It only has background and all the
controls on it disappeared. I'd like to let it display an informed message
like "No record is found, please search again". How can I do that? Thank you.
I have a page to let user type in a"key" and search my database. Then
another page is opened to display the result. My code is as follow:
Private Sub btnSearch_Click()
On Error GoTo Err_btnSearch_Click
Dim strSQL As String
strSQL = "[tbPatient].[Name]=Forms![frmSearch].[Name]"
DoCmd.OpenForm "frmSearchResult", , , strSQL
Exit_btnSearch_Click:
Exit Sub
Err_btnSearch_Click:
MsgBox Err.Description
Resume Exit_btnSearch_Click
End Sub
My problem is when no record is found after search, the display page
"frmSearchResult" seems to partly open. It only has background and all the
controls on it disappeared. I'd like to let it display an informed message
like "No record is found, please search again". How can I do that? Thank you.