E
ElizaD
I am trying to figure out how to create the code that would open a popup
message box if the record count for a table is greater than 0 with a yes/no
choice to continue or not. If there are no records in the table, then no
message box would show. I do not need to know the actual record count.
Private Sub OpenReqUpdate_Click()
On Error GoTo Err_OpenBARUpdate_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Request Update Form"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenReqUpdate_Click:
Exit Sub
Err_OpenReqUpdate_Click:
MsgBox Err.Description
Resume Exit_OpenReqUpdate_Click
End Sub
Main Form: Select command button “Open Request Update†(code above)
Insert the following in the above code:
If Record Count of tblReqDetails is < 0, then
continue on to open “Request Update Formâ€
Else If Record Count of tblReqDetails is >0, then
Message Box stating “Request already exists, continue?â€
If No, then do nothing
If Yes, continue on to open “Request Update Formâ€
I can find bits and pieces of what I want on the web and in my books, but I
am having a difficult time putting it all together. Any help would be
appreciated.
message box if the record count for a table is greater than 0 with a yes/no
choice to continue or not. If there are no records in the table, then no
message box would show. I do not need to know the actual record count.
Private Sub OpenReqUpdate_Click()
On Error GoTo Err_OpenBARUpdate_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Request Update Form"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenReqUpdate_Click:
Exit Sub
Err_OpenReqUpdate_Click:
MsgBox Err.Description
Resume Exit_OpenReqUpdate_Click
End Sub
Main Form: Select command button “Open Request Update†(code above)
Insert the following in the above code:
If Record Count of tblReqDetails is < 0, then
continue on to open “Request Update Formâ€
Else If Record Count of tblReqDetails is >0, then
Message Box stating “Request already exists, continue?â€
If No, then do nothing
If Yes, continue on to open “Request Update Formâ€
I can find bits and pieces of what I want on the web and in my books, but I
am having a difficult time putting it all together. Any help would be
appreciated.