Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check box 1

Status
Not open for further replies.

achiola

MIS
Apr 26, 2001
44
US
Hi guys,
I have a text box on a Form that requires the user to input a date. I also have a check box that requires the user to click on it once the date has been entered. Is there a way to make the text box contingent on the Check(Option)box so that when the user clicks on the Check box the text box will display today's date and store it in a table as such?

Nino
 
In the CheckBox's On Click event type the following

TextBoxName = Date()

B-) ljprodev@yahoo.com
ProDev
MS Access Applications
 
Yes, there is.
Data source of txtTextBoxForTodayDate must be same table field what you would like to update

private sub chkCheckBox_AfterUpdate()
if me.chkCheckBox=true then
me.txtTextBoxForTodayDate=date() 'Or =now()
else
'You can write codes for otherwise
'operation (e.g. me.txtTextBoxForTodayDate=Null)

endif
end sub


Aivars


 
Aivars way is the better way. I'm sorry, I did not account for the True/False property of the checkbox. ljprodev@yahoo.com
ProDev
MS Access Applications
 
Thanks Aivars,
That worked perfectly! Thanks a lot.

Nino
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top