Question Message Box Warning

Clownfish1980m

Clownfish8182m
Local time
Today, 16:26
Joined
Sep 18, 2009
Messages
40
I have created a database containing medications. The user can add new medications or update current medications in the system. I created a dropdown combo box to allow the user to select a status (field is called “Status”) of either “Addition” or “Change” and a field for “Status Date” to put the date the addition or change was added to the system. To make it easier for users, I put a command button which when pressed puts today’s date. What I want to do is create a message box to remind the user to please select a “Status” when the status is empty but a date was added to the “Status Date”. This prevents the status field from being null when an addition/change date is added. I have been working from several books but can’t get the coding down. Thanks Ken
 
You don't need a command button for date.
You can put "Default" poroperties for this field in the table.
Or you can to make a "Before update" event (form before update).
In Sub Before Update put;

[Me.fieldName] = Date()
 
I don't want it to default to today's date since there are medications already in the system that are not being updated or added. By putting a date in the date field it populates a report that is called up by date range to show all the new medications added or modified. Ken
 
MStef you made me think and you are correct. I could build an "if then statement" that when a status is selected it will automatically put in today's date to show when the midicaiton was added or changed. That solves the need for a message box. Thanks
 
In the button where users press to enter todays date put this code in the On click event :
If Me.(nameofcomboboxforstatus).Value = Null Then MsgBox "Please first select a Status"
Else (fill in the date value...)
 

Users who are viewing this thread

Back
Top Bottom