I have the following code below and it works great. Basically I click on a button and it goes to another form and only shows data that matches my combo boxes. I would like to add code that also checks to see if another field is empty (txtRefNoDoc). If it's empty I would like a msgbox to display saying they have to fill in that field first BEFORE they go on and then have the cursor move to the txtRefNoDoc field waiting for input. Any ideas?
Private Sub cmdCreateCoverPage_Click()
On Error GoTo Err_Command151_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmContractCoverPage"
stLinkCriteria = "[lngMachineID]=" & Me![cboPRDPLSelect]
stLinkCriteria = "[lngVendorID]=" & Me![cboPRVendorSelect]
DoCmd.OpenForm stDocName, , , stLinkCriteria