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

How to pass a variable in VBA code by opening a form and storing the variable

Status
Not open for further replies.

AJAY0618

IS-IT--Management
Mar 14, 2023
3
US
Hello,

I hope this is not a repeat of a question. I have form2 that opens when a user clicks a button on form1. Now the user is asked to select a date using picker and that date is passed to a hidden textbox on Form1. Now the code in the button continues to run and utilize this date however it seems it is using the last value in the textbox before the new one populates even though the code is well after the form2 opens. I user this value to update a recordset field. Any ideas how I can achieve this?
 
AJAY0618 said:
the user is asked to select a date using picker [on Form2?] and that date is passed to a hidden textbox on Form1

What code do you use to pass a date from a date picker on Form2 to a hidden textbox on Form1?
And where is this code located?

AJAY0618 said:
the code in the button [on Form1?] continues to run and utilize this date

Could you show the code in this button?

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Never mind! I ran the code on Form2 to update the recordset by passing openargs from Form1 to Form 2
 
When the user selects a date on Form2 the actual date selected is passed to update the recordset
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top