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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to control checkbox datepicker ms access 2010

Status
Not open for further replies.

Panchovia

Programmer
May 6, 2010
48
CW
the following code will change the date in the date field to the current date the check box will checked

on current event
If Me.Newrecord then
Me.Dtpicker6.value= date
End if

what code do you have to use to control the checkbox aside of the date so it comes without the check mark to force the user to confirm the date.
 
To control the checkbox value, you just need to set it to TRUE for checked and FALSE for unchecked...

Is that all you're asking? If not, please provide more information/depth to your question.

So....
Code:
Private Sub Form_OnCurrent
  If Me.Newrecord Then
    DtPicker5.Value = Date
    MyCheckBox = TRUE
  Else
    MyCheckBox = FALSE
  End If
End Sub

I'm assuming you want it checked if you put in the default value, and not checked if you don't put in the default value... and assuming that decision is based solely on whether it's a new record or not. You'll need to modify the above to fit your needs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top