Date Warning MsgBox

B

Bob Vance

If text box [tbDatefrom] equals [tbDateto] when i click this Control Button
can I get a warning box
to add to this control
MsgBox "Please make a Start Date Selection!", vbApplicationModal +
vbInformation + vbOKOnly
-----------------------------------
If IsNull(cbHorseName.value) = True Or cbHorseName.value = vbNullString
Then
MsgBox "Please make a Selection!", vbApplicationModal +
vbInformation + vbOKOnly
Exit Sub
End If

Me.Visible = False
DoCmd.OpenReport "rptMonthlyHorseInvoice", acViewPreview
DoCmd.Close acForm, Me.Name
 
P

pietlinden

If text box [tbDatefrom] equals [tbDateto] when i click this Control Button
can I get a warning box
to add to this control
  MsgBox "Please make a Start Date Selection!", vbApplicationModal +
vbInformation + vbOKOnly
-----------------------------------
 If IsNull(cbHorseName.value) = True Or cbHorseName.value = vbNullString
Then
                MsgBox "Please make a Selection!", vbApplicationModal +
vbInformation + vbOKOnly
                Exit Sub
            End If

in the button's Click event,...
if me.[tbDateFrom]=me.[tbDateTo] Then
Msgbox "Please make a Start Date selection!", vbOkonly
+vbInformation
me.[tbDateTo].SetFocus
End if
 
B

Bob Vance

Thanks Piet I just put an Exit Sub after it and it worked perfect :) :)
Regards Bob

If text box [tbDatefrom] equals [tbDateto] when i click this Control
Button
can I get a warning box
to add to this control
MsgBox "Please make a Start Date Selection!", vbApplicationModal +
vbInformation + vbOKOnly
-----------------------------------
If IsNull(cbHorseName.value) = True Or cbHorseName.value = vbNullString
Then
MsgBox "Please make a Selection!", vbApplicationModal +
vbInformation + vbOKOnly
Exit Sub
End If

in the button's Click event,...
if me.[tbDateFrom]=me.[tbDateTo] Then
Msgbox "Please make a Start Date selection!", vbOkonly
+vbInformation
me.[tbDateTo].SetFocus
End if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top