Question auto fill text box on onload another form (1 Viewer)

ausajid

New member
Local time
Today, 01:38
Joined
May 9, 2015
Messages
17
Hi all,

i have started access and create a database. if some one can help the following please.

i will be much appreciated.

i have a subform "line 1", in that form i have a multiple fields. on one of them i have put click event which open another form called "his", i want to automatically fill in one of the text box in his form of the same line where i have a click event.

any help
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:38
Joined
Aug 30, 2003
Messages
36,124
Right after the OpenForm line:

Forms!his.TextboxName = Me.TextboxName

Replacing the two names as appropriate.
 

ausajid

New member
Local time
Today, 01:38
Joined
May 9, 2015
Messages
17
thank you Paul, i have tried, but noting happening.
Private Sub Form_Load()
Forms!his.test = Me.test
End Sub
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:38
Joined
Aug 30, 2003
Messages
36,124
I said after the OpenForm:

DoCmd.OpenForm "his"
Forms!his.test = Me.test
 

ausajid

New member
Local time
Today, 01:38
Joined
May 9, 2015
Messages
17
thank you Paul

still not working.

sorry i think i could not explain you well.

i have a subform "line1" in which i have "work_order_No", "pib_no" etc. in another form "his" i have again "work_order_No", "test", etc. i have click event on "line1"'s "work_order_No". soon i click on the this field, "his" open with the particular work_order_number pre-filled in. i want the db to fill the PIB_NO from LINE1 form into HIS test field.

hope this will be clear now.

your help will be appreciated.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:38
Joined
Aug 30, 2003
Messages
36,124
Sounds like you need to refer to that field instead of test then. Can you attach the db here?
 

ausajid

New member
Local time
Today, 01:38
Joined
May 9, 2015
Messages
17
hi,

thanks again,

i think i was referring the event on wrong form.

it is now sorted and my final codes are

Private Sub Work_Order_Number_Click()
DoCmd.OpenForm "his", acNormal, "", "", acAdd, acNormal
Forms![his]![WONO] = Me.[Work_Order_Number]
Forms![his]![test] = Me.[PIB_No]
End Sub

thank you anyway for your time and help,
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:38
Joined
Aug 30, 2003
Messages
36,124
Happy to help.
 

Users who are viewing this thread

Top Bottom