|  | Date Warning MsgBox |  | |
| | | Bob Vance |  |
| Posted: Mon Aug 25, 2008 10:40 pm Post subject: Date Warning MsgBox |  |
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 -- Thanks in advance for any help with this......Bob WindowsXP..MS Access 2007 |
| |
| | | pietlinden@hotmail.com |  |
| Posted: Tue Aug 26, 2008 3:30 am Post subject: Re: Date Warning MsgBox |  |
On Aug 25, 7:40 pm, "Bob Vance" <rjva...@ihug.co.nz> wrote:
| Quote: | 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 |
| |
| | | Bob Vance |  |
| Posted: Tue Aug 26, 2008 3:42 am Post subject: Re: Date Warning MsgBox |  |
Thanks Piet I just put an Exit Sub after it and it worked perfect Regards Bob
<pietlinden@hotmail.com> wrote in message news:f83b3804-4d9d-4a6e-9052-3e5cf7c757e9@m36g2000hse.googlegroups.com... On Aug 25, 7:40 pm, "Bob Vance" <rjva...@ihug.co.nz> wrote:
| Quote: | 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 |
| |
|
|