Pass number from main form to third form

M

mnsebastian

Hello,

I have three forms:

1) frmMain - cboAssetNum
2) fsubproperties - Skip Command Button
3) fskip - Skip option group

I want to pass the cboAssetNum to the fskip form and update a table.
Below is the code I have:

DoCmd.RunSQL "INSERT INTO tblVendorAssignment (SkipDate, VendorID,
AssetNumber, SkipReason) VALUES (#" & Format(Me.txtcurrdate,
"mm/dd/yyyy") & "#, '" & Me.txtVendorID & "', '" & Me.cboAssetNum &
"','Slow Response')"

I keep getting the error can't reference parent property.

Can someone please help. Thank you!
 
M

mnsebastian

This is what the code was:

DoCmd.RunSQL "INSERT INTO tblVendorAssignment (SkipDate, VendorID,
AssetNumber, SkipReason) VALUES (#" & Format(Me.txtcurrdate,
"mm/dd/yyyy") & "#, '" & Me.parent.txtVendorID & "', '" &
Me.cboAssetNum &
"','Slow Response')"

and I am getting that error. . .
 
G

Guest

try forms.MainFormName.SubFormName.form.ControlName

obviously the subformmname is only needed to reference a control on the
subform

look under help in sub forms for various syntax examples

hope this helps further.

TonyT
 
M

mnsebastian

Thank you I figured it out!
try forms.MainFormName.SubFormName.form.ControlName

obviously the subformmname is only needed to reference a control on the
subform

look under help in sub forms for various syntax examples

hope this helps further.

TonyT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top