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

Simple code... but... copy & Paste

P: n/a
Experts,
Please share some light on this simple thing... I am so preplexed.
Bascially, I am trying to copy Product Name from an open form and
paste it to the Product Name field in Form2.
Dim ProdNm As String

ProdNm = Me.[ProductName]

DoCmd.OpenForm "Form2", , , , acFormAdd

Me![PurchaseOrdersSubform].Form![ProductName] = ProdNm
What did I code wrong? Why is this not working?

Thanks in advance.
Perry

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Me![PurchaseOrdersSubform].Form![ProductName] = ProdNm

should be:

Forms!Form2.ProductName.Value = ProdNm

Assuming that ProductName is the name of the control in Form2 that you
want to paste the value to.

You could also pass the value to Form2 in the OpenArgs portion of the
OpenForm command, and then have code in the FormLoad event of Form2 to
put it in the textbox you want.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.