Stupid Question of the Day! (1 Viewer)

Cat_129

Registered User.
Local time
Today, 20:40
Joined
Sep 18, 2019
Messages
36
I think my brain is broken!

I have a form which contains a subform, I have a field on the main form called Problem ID, and a button below.

When the button is clicked, it uses Dlookup to find certain values of that problem from a table and input them onto either the form or subform depending on what it is. I can get the data to transfer to the form perfectly.

What I can't do, is get the data to transfer to the subform. I have tried every variation of the below I can think of but nothing is working. I simplified it to just input 3 until I get it working.

Forms!Deviations!SubformDeviations.From.txtPartNumber.Value = "3"

I know its something simple. Thank You
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 20:40
Joined
Jan 14, 2017
Messages
18,246
Code:
Forms!Deviations.SubformDeviations.Form.txtPartNumber = "3"
Or if you are on the main form use
Code:
Me.SubformDeviations.Form.txtPartNumber = "3"

NOTE this assumes SubformDeviations is the name of the control containing the subform.
Also that part number is a text field. If its a number field, omit the quote marks

A useful reference for handling subform references http://access.mvps.org/Access/forms/frm0031.htm
 
Last edited:

Cat_129

Registered User.
Local time
Today, 20:40
Joined
Sep 18, 2019
Messages
36
Code:
Forms!Deviations.SubformDeviations.Form.txtPartNumber = "3"
Or if you are on the main form use
Code:
Me.SubformDeviations.Form.txtPartNumber = "3"

NITE this assumes SubformDeviations is the name of the control containing the subform.
Also that part number is a text field. If its a number field, omit the quote marks

A useful reference for handling subform references http://access.mvps.org/Access/forms/frm0031.htm

Superstar, Thank you
 

Users who are viewing this thread

Top Bottom