Update textbox in main form from subform

safeerbinsalih

Registered User.
Local time
Tomorrow, 01:45
Joined
Dec 30, 2015
Messages
26
I've a main form and a sub form. I've a textbox (txtbx) in main form. I want to update value of txtbx with record from subform while I go from one record to next. I found that I've to use "On Current" event. How to code to update txtbx

Main form : Form1
Sub form : Form2

I want to update value of txtbx in Main from from text box "Material" in Form2. This value should change each time I click on different records. Any help is deeply appreciated
 
Thanks a lot. That link really helped. Record is updating in text box. :)

But text box is not updating when I go to new record.
:confused:
I used Me.Refresh
 
Did you just add code to the Current Event of the SubForm? If so, can you post it so I can see what you did?
 
Yes. I added code to current event. Here is the code

Private Sub Form_Current()
Me.txtbx = Me!Form2.Form!Material
Me.Refresh
End Sub
 
I would think you would put your code in the Current Event of the *SubForm* rather than the MainForm.
 
Oops. I'm sorry. My mistake.
But in property sheet of subform I can only find events "On Enter" and "On exit".
 
He means go into the form being used as a subform, not the subform control.
 
You're most welcome. Do you want to use the Thread Tools at the top of the thread to mark this thread as Solved?
 

Users who are viewing this thread

Back
Top Bottom