Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing values from FORM A to FORM B.....????

Status
Not open for further replies.

julie194

Programmer
Aug 13, 2001
1
US
HELP! PLEASE!!! PROJECT IS DUE SOON!!! How do I assign a value from form A to a control on form B that I have called from form A?? I am using the SetValue action within the same Macro that I am using to open form B, but I am having problems satisfying the Item and Expression parameters. The error claims that "Ambiguous name detected", but I am setting the parameters with the expression builder. Any and all help will be appreciated. Thanks!!!!
 
are you using this context

forms!FormB!fieldname = value

good luck
 
try something like this, i am currently using this code to take a value from the input form and posting the vale to another table.

Private Sub Form_AfterUpdate()
'For new records take item and classification info and adds to shipping/processing tables
DoCmd.RunSQL "INSERT INTO tblShipping ( ItemNo, ClassNo ) VALUES([Forms]![frmDepository Additions]![ITEM #], [Forms]![frmDepository Additions]![CLASS #]);"
'DoCmd.RunSQL "INSERT INTO tblProcessing ( ItemNo, ClassNo, Division ) VALUES([Forms]![frmDepository Additions]![ITEM #], [Forms]![frmDepository Additions]![CLASS #], [Forms]![frmDepository Additions]![Division]);"

Exit Sub


End Sub
 
another way is to create a button that when pressed will open form b.

for the OnClick of the button create a macro
echo
openForm (in the properties this is object form) and form name form b

SetValue
Item [Forms]![form b]![value from form a]

Expression [form a value]

do as many setvalues as you need to bring data overto form b

from b has to updated after form a is done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top