Hi All... yet another question : )
I have a few forms for adding data where I have and OK cmd button and a Cancel cmd button. On the OK cmd button,if there has been no data added I would like a msgbox to appear (Please complete the job record... or something along those lines). The code I have is as follows:
However the form saves and closes regardless. I think the problem is that the postcode field is automatically populated when the form loads, therefore the form is dirty from being loaded. So I tried
But then I get a Run Time error 424... Object Required
Any Idea would be great, Many Thanks
Jane
I have a few forms for adding data where I have and OK cmd button and a Cancel cmd button. On the OK cmd button,if there has been no data added I would like a msgbox to appear (Please complete the job record... or something along those lines). The code I have is as follows:
Code:
If Me.Dirty = False Then
MsgBox ("Please enter the details for this job."), vbExclamation, "Missing Data"
ElseIf Me.Dirty = True Then
'Save new property details.
DoCmd.Save
DoCmd.Close acForm, "frm_newJob", acSaveYes
End If
Code:
If Me.Details is null Then
MsgBox ("Please enter the details for this job."), vbExclamation, "Missing Data" ....etc
Any Idea would be great, Many Thanks
Jane
Comment