snoopy92211
Technical User
I have this function that updates a table, tblTable with additional fields, etc. That all works fine and dandy. However, I have to check if a code in tblTable matches with a code in tblMaster. That also works fine and dandy. If the code doesn't match in tblTable, I have a form that pops up in the module with the missing name. The user can then update the name and the module can continue with appending the fields.
Here is my problem. How can I pause/stop the module if this criteria is true (meaning the name is missing); when they enter the information itno the form, the code re-executes and checks the name. No names are missing from tblTable, and it updates/appends the correct fields.
here's the code:
Code:
Dim rstlocations As DAO.recordset
Set rstlocations = db.openrecordset("tbltable Without Matching tblmaster")
If rstlocations.RecordCount = 1 And rstlocations.BOF = rstlocations.EOF Then
DoCmd.OpenQuery "Updatew/Name", , acEdit
DoCmd.OpenQuery "qry1" , acEdit
DoCmd.OpenQuery "qry2", , acEdit
DoCmd.OpenQuery "qry3", , acEdit
DoCmd.OpenQuery "qry4", , acEdit
Else
MsgBox "You have not added all the Names to the database. You will not be able to" _
& " Import the table unless you add all the Names", vbExclamation, "Error"
DoCmd.OpenForm "Unmatched", , , "Name <> ' '"
Exit Function
End If
Call CheckforMatches