Private Sub Command86_Click()
If Me.NewRecord Then
If Nz(Me.Aliasdate) > 0 And Me.aliasamount = Null Or Me.aliasamount = 0 Or Me.Aliasdate = Null Or Mycheckbox = False And DTPicker6.Value = Date Then
MsgBox ("No record will be added"), vbOKCancel
Beep
End If
Else
MsgBox ("Saving record"), vbOKCancel
Beep
DoCmd.RunCommand acSaveRecord
End If
End sub
This button should evalute the date picker values to save the record or not
if the user does enter the form by mistake and click on this button it should give him the message no record will be added and then exit ( the dtpicker checkbox is then unmark but you seee the current date in the dtpicker right now this does work when you click on the comman button)
if the user enter the form and activate only the dtpicker and does not fill in the other fields and opts for exit it should give the message no record will be added (this part works fine with the code)
when the user enters the form and click on the dtpicker and he fills all the field it should give him the message saving record and the exit the form to the main form,(this part doesn't work)
What do I miss in this code.
Panchovia
If Me.NewRecord Then
If Nz(Me.Aliasdate) > 0 And Me.aliasamount = Null Or Me.aliasamount = 0 Or Me.Aliasdate = Null Or Mycheckbox = False And DTPicker6.Value = Date Then
MsgBox ("No record will be added"), vbOKCancel
Beep
End If
Else
MsgBox ("Saving record"), vbOKCancel
Beep
DoCmd.RunCommand acSaveRecord
End If
End sub
This button should evalute the date picker values to save the record or not
if the user does enter the form by mistake and click on this button it should give him the message no record will be added and then exit ( the dtpicker checkbox is then unmark but you seee the current date in the dtpicker right now this does work when you click on the comman button)
if the user enter the form and activate only the dtpicker and does not fill in the other fields and opts for exit it should give the message no record will be added (this part works fine with the code)
when the user enters the form and click on the dtpicker and he fills all the field it should give him the message saving record and the exit the form to the main form,(this part doesn't work)
What do I miss in this code.
Panchovia