populate contents of a text box, based on data in another textbox

lals101

Registered User.
Local time
Today, 02:10
Joined
Jun 8, 2010
Messages
10
Hi all,
I am sort of new to access and VB. I want to update/populate a text box (textbox_2) in one form (frm_enter_2) based on the entry of data in another text box (textbox_1) in form (frm_enter_1).

Ideally I'd like this to be an afterupdate event, such that after the data is entered in textbox_1 the data appears in textbox_2, in frm_enter_2

I hope this is clear, any help would be greatly appreciated!

thanks in advance

lals
 
Hi thanks for that, but I'm not quite sure where to start with the website

I saw this code used in a similar post:

Private Sub Command7_Click()
DoCmd.GoToControl "Project ID"
DoCmd.RunCommand acCmdCopy
Docmd.OpenForm "The form name goes here"
DoCmd.GoToControl "Project ID"
DoCmd.RunCommand acCmdPaste

End Sub

but this opens the form, my form, frm_enter_2, is a sub form within frm_enter_1.
and i don't wish to open it seperately.

also this is on click is there a simple way to change this to an afterupdate event

thanks
 
In the After_Update event of textbox_1 you would just equate its value (on the RHS) to the value of textbox_2 (on the LHS). Ensure that textbox_2 has nothing in the Control Source property.

Something like this:

Code:
Private Sub texbox_1_AfterUpdate()
    Forms("frm_Enter_2").Controls("textbox_2").value = textbox_1.value
End Sub
 
Great, pointed me in the right direction thanks!
 

Users who are viewing this thread

Back
Top Bottom