G
Gus
Hello,
I am trying to create an event where the code will look for no results after
a query. If there are not results I want a prompt to ask the user to add
Yes/No message box. Once they select either yes or no then I want the forms
to open. I hope someone can help.
Private Sub Form_Load()
Dim rst As DAO.Recordset
'Specifies to User if no record found then add
Set rst = Me.RecordsetClone
If rst.RecordCount = 0 Then
Dim Response As Integer
Response = MsgBox("Agreement Not Found. Please make sure it was typed in
Correctly. You may need to add the Record. Do you want to Add?", vbYesNo,
"Continue")
If Response = vbYes Then
DoCmnd.OpenForm "New_Agreement_Number_Log_Form"
Else
Docmd.OpenForm "Agreement_Search_and_Check_Out_Form"
End If
End Sub
My code currently is not working.
Thanks.
I am trying to create an event where the code will look for no results after
a query. If there are not results I want a prompt to ask the user to add
Yes/No message box. Once they select either yes or no then I want the forms
to open. I hope someone can help.
Private Sub Form_Load()
Dim rst As DAO.Recordset
'Specifies to User if no record found then add
Set rst = Me.RecordsetClone
If rst.RecordCount = 0 Then
Dim Response As Integer
Response = MsgBox("Agreement Not Found. Please make sure it was typed in
Correctly. You may need to add the Record. Do you want to Add?", vbYesNo,
"Continue")
If Response = vbYes Then
DoCmnd.OpenForm "New_Agreement_Number_Log_Form"
Else
Docmd.OpenForm "Agreement_Search_and_Check_Out_Form"
End If
End Sub
My code currently is not working.
Thanks.