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!

Set value of a control based on where the call came from

Status
Not open for further replies.

jlindquist

Programmer
Jun 8, 2001
14
0
0
US
I have a form that holds a date submitted and a due date value on it. Next to each I have a button to pop up the same little calendar. Upon selection of a date I would like to set the value of the control where the original call came from.

Form Project
Date Submitted: (BUTTON)--> Pop open calendar
Due Date: (BUTTON)--> Pop open calendar

Upon selection of a date I want to do something like Forms![FORM]![CONTROL].value = Calendar.value where FORM and CONTROL are where the value should be put based on where it originally came from.
 
If you using only a single form then all you need to do is to send the control name of the date field to the calendar form using OpenArg

for example when you open the form from the button use the command
docmd.OpenForm "frmCalendar",,,,,,"DueDate"
(OpenArg is the 7th Parameter)
Where DueDate is the name of your control

then on your calendar form use the command
Forms!<Your Form Name>.controls(me.openArg)= Calendar.value

HTH

*
***
*****
*******
Ziggurat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top