Hello Experts and thank you in advance
I have a form [createdayworkmenuform] with three combo boxes
Project No [createprojectvo]
Variation No [editvonumber]
Works Instruction Number [editswnumber]
When you select the project No record in combo box [createprojectvo] the Variation No combo box [editvonumber] updates based on a query [Attachment Query 1] and the variations for that projects are the available records in combo box Variation No [editvonumber].
And the same happens when you select a record for the Variation No Combo box [editvonumber] the Works Instruction Number combo box [editswnumber] updates based on a query [Attachment Query 2] and the work instructions are the available records in the combo box Works Instruction Number combo box [editswnumber].
All works well but I want to introduce some user functionality by alerting the user that no records exists before they input each combo box.
If a project has no Variations then after you enter the project I want a message box to alert "No Variations have been created for this project"
And the same for work instructions when you select the variation no. If no work instructions do not exist then a message box " No Work instructions have been created for this project"
Not sure if I need DCount or something like the code I have been trying without success
If DCount("*", "Editswnumber= " & Me.EditSWNumber) < -1 Then
MsgBox "No Work Instructions exist for this project !", vbInformation, "CMWorkflow Data Required"
Me.NoRecords.Visible = True
The above code does not actually fire up the message and not sure why.
Thanks in advance