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!

Using Global Var's to Ref Objects

Status
Not open for further replies.

crose7227

Programmer
Jul 26, 2001
64
0
0
US
I have a problem where I want to be able to call a calendar control from any form and pass that forms name and the name of the text box to update with the calendar's value.

I have tried assigning the name of the form/textbox to globals. My problem is that I dont know the method to reference a form using a global variable... such as



Forms!varFormFrom.varTextBox.value = ActivexCtl0

this does not work...

Has anyone else ran into this problem? Long Live Motor
 
In a module(global not object)
Global FormToUse As Form

In button OnClick of Form module of form where the date will end up

Set FormToUse = Me
DoCmd.OpenForm "YourCalendarForm"

In button OnClick of form module of YourCalendarForm

FormToUse.Controls("YourDateTextBox").Value = Me.YourCalendarControl.Value
DoCmd.Close

JHall
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top