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

SetValue of Unbound Text box to DTPicker

Status
Not open for further replies.

kptasteve

Programmer
Nov 2, 2002
43
0
0
US
I know I should know how to make this work, but it continues to allude me. How do I use an ActiveX control DTPicker to chose a date then use the values to query for a report. I would like to assign it also to an unbound text box.

Steve Marcum PT
Programmer
 
This should do it for you:

Set the DTPicker to the current system date when the form opens:
Private Sub Form_Load()
Dim varDate
varDate = Date
Me!ActiveXCtl0.Value = varDate
End Sub

Update the text box to the selected date in theDTPicker :
Private Sub ActiveXCtl0_Change()
Me!TheTextBoxName = Me!ActiveXCtl0.Value
End Sub

Obviously, change ActiveXCtl0 to your DTPicker control name and TheTextBoxName to your text box or control name.

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top