By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,510 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,510 IT Pros & Developers. It's quick & easy.

Referring to a control in the subform footer

100+
P: 166
Hello:

I would like to use information on one form to populate another form. There are 2 controls I would like to transfer; a list box control and a text box control. both are unbound controls in the subform footer of the form F_MixDesign.
Form1: F_MixDesign
Subform1: SF_MixSample
Control name: txtWaterReqWt

Form2:FSampleRequest
Subform2: SF_SampleRequest
Control name: txtWater

Both the control I would like to copy and the control that will be copied to are in the subform footers.

I have a button on form1 that when clicked will open form2. Here is my code, but I know it's wrong because it doesn't work.

Private Sub btnOpenSampReq_Click()

DoCmd.OpenForm "F_SampleRequest"
'Open F_Sample Request

Forms!F_SampleRequest.Controls!txtWater = Forms!F_MixDesign.Controls!ListWater
Forms!F_SampleRequest.Controls!txtWatReqWt = Forms!F_MixDesign.Controls!txtWaterReqWt
End Sub

I have also tried using:
Me!SF_SampleRequest.Controls!txtWater = Me!SF_MixDesign.Controls!ListWater
Dec 10 '08 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,287
From here:
Forms: Refer to Form and Subform properties and controls

Forms!Mainform!Subform1.Form!ControlName = Me!Subform1.Form!ControlName

so

Forms!FSampleRequest!SF_SampleRequest.Form!txtWate r = SF_MixSample.Form!txtWaterReqWt
Dec 10 '08 #2

100+
P: 166
Chip,

You are wonderful! Thank you.

I tried to use that reference initially, but I can't understand it really...thank you
Dec 10 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.