Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Transfer Textbox value and run code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jenny at APOC - 19 Apr 2005 14:47 GMT
How do you transfer a Textbox value from Form1 to Form2 and then have code
run on that value that you have transferred?
Klatuu - 19 Apr 2005 15:19 GMT
It will depend on whether Form2 is open at the time you want the transfer to
take place.  If both Form1 and Form2 are open, you could put this line in the
Lost Focus Event of the text box on Form1:
[forms]![Form2]![MyTextBox2] = Me.MyTextbox1

If Form1 opens Form2, then you will want to use the OpenArgs property.  
Access Help has an example of how to use the OpenArgs property.

> How do you transfer a Textbox value from Form1 to Form2 and then have code
> run on that value that you have transferred?
Jenny at APOC - 19 Apr 2005 18:52 GMT
I can get the values to transfer.  Form1 meets certain crtieria and then
Form2 opens and viceversa, but in order to get the code to run I have to
backspace over the last digit and re-enter it.  OR if OepnArgs is the answer,
I cannot get that to work....just gives me a null value.  

> It will depend on whether Form2 is open at the time you want the transfer to
> take place.  If both Form1 and Form2 are open, you could put this line in the
[quoted text clipped - 6 lines]
> > How do you transfer a Textbox value from Form1 to Form2 and then have code
> > run on that value that you have transferred?
Klatuu - 20 Apr 2005 16:36 GMT
sooooooooooo you didn't tell me everything, huh?  :)
Based on what you posted last, it appears that the text box you want the
value to pass from is not the last control to have the focus before it opens
Form2.
In that case, you need to use the Openargs property.  It wont happen on it's
own, you will have to put some code in Form2 Open event to use the passed
value.  Look in Access Help for OpenArgs property and the OpenForm Method.  
The OpenArgs property example should explain it all.

> I can get the values to transfer.  Form1 meets certain crtieria and then
> Form2 opens and viceversa, but in order to get the code to run I have to
[quoted text clipped - 11 lines]
> > > How do you transfer a Textbox value from Form1 to Form2 and then have code
> > > run on that value that you have transferred?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.