Errror message set off prematurely on mouse down event

  • Thread starter Thread starter Alex Martinez
  • Start date Start date
A

Alex Martinez

I have a combo box in my form when pressed a Microsoft calendar pops-up and
the user select the date from the calendar and it will display the date on
the combo box, all this is trigger from on mouse down event. Not a
problem works fine. If any of my text boxes are not populate by the user on
the form a error message box will appear stating that you have not inputted
information on the text box. This should happen when I go to the next
record or add a record or close, the coding is done thru on the
Form_BeforeUpdate event. The problem I have is that the error message set
off prematurely when I select a date this should not occur only when I go to
the next record. I don't really don't want to change the coding in my mouse
down event. Any tips will be appreciated. Thank you in advance.
 
Alex,
The "error" (which really isn't an error) is probably due to the fact
that you have "Required" fields on your form. Normally, upon leaving the
record, the Update that occurs at that time causes the "entry required"
message to display if any reqired fields do not have entries.
If a field is Required, any Update or Refresh or Requery will check for
valid entries at that time.

In this case, somethingin getting the date from the calendar to your
field (whether from the calendar control, or in your code) is causing an
Update to occur, hence the message fires.
Examine any code you wrote to place the cal value into your field.

Also, I'm questioning why you're using a combo box to store a value from
a calendar control. Combo boxes doesn't usually derive their value from an
outside source. They should derive their value from the items listed within
themselves (ex. an item from the query recordset behind the combo)
From what you've described, a text control would be the proper tool for
receiving the Date value.
 
Back
Top