Pull data from one form into another

T

Tom Brown

How can I pull an entry placed in a textbox in form 1 into a textbox in form
2, and have the data in the textbox in form 2 change as soon as the data in
the textbox in form 1 changes? The change needs to be instantaneous, as the
textbox in form 2 will be hidden from the user, so he wont know it is there
and wont try to refresh the data himself. Any help will be greatly
appreciated.

Tom Brown
 
B

Bob Quintal

How can I pull an entry placed in a textbox in form 1 into a
textbox in form 2, and have the data in the textbox in form 2
change as soon as the data in the textbox in form 1 changes?
The change needs to be instantaneous, as the textbox in form 2
will be hidden from the user, so he wont know it is there and
wont try to refresh the data himself. Any help will be greatly
appreciated.

Tom Brown
Since you are working in form 1 it would be much easier to push
the data from form 1 into form 2 than pull the data from form 1
into form 2.

To do that, use the afterupdate event of the textbox on form 1.
Forms!form_2!textboxonForm2.value = me!textboxonform1.value.

change the names as applicable.
Note that if form 2 is not open, you will get an error message.
Google for a public function called fIsOpen() to test for that.
 
J

Jeff Boyce

Tom

You've described a "how". Now how about describing the "why".

You've come up with a solution (entry in Form1 goes to Form2) ... but you
are trying to do this to help you solve some business need.

If you'll describe that a bit more, the folks here might be able to better
advise you.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
T

Tom Brown

Sure Jeff, thanks.

There are actually 3 screens, a Login form, a Full Service driver form and a
Trade driver form. All three forms must post data to the Master_Temp table.
Mgmt wants the login screen to be stand alone, So the login screen will be
the first screen the user chooses. When the user logs in, he will then
choose either the Full Service driver form OR the Trade driver form to enter
the deposit the driver brings to the cashier window. The cashier handles
one driver at a time. I need to have the login screen data and the driver
screen data hit the SAME row in the Master_Temp table. All my testing shows
the Login screen data is posted to the Master_Temp table once the user
leaves the Login screen to choose either of the driver screens, so the Login
data and the Driver deposit data each create a separate row in the
Master_Temp table. My problem is, I can't see a way to have the Login screen
and the Full Service or Trade driver screen post the data entered by the
user post to the SAME line in the Master_Temp table. I originally asked my
question because I decided to try to create textboxes on each Driver form to
pull the data entered into the Login form, then hide the textboxes from the
user so he wouldn't play around with them. This would pull the login data
into a driver form, which along with the driver info would then post to the
Master_Table as one entry. I hope I explained this adequately. Any advice
is greatly appreciated.
 
T

Tom Brown

I figured it out.
For the Login form, I created a Login_Temp table to accept the Login info
from the Login form. This is also good because the Login_Temp table keeps a
record of the individuals logging in. I then did as I described earlier. I
created textboxes on each Driver form to pull the data from the textboxes on
the Login form. I made the textboxes invisible to the user. The Driver
forms are using the Master_Temp table as their Record Source. When I test
this it posts the data from both the Login form and the individual driver
forms to the Master_Temp table as one row.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top