467,907 Members | 1,418 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,907 developers. It's quick & easy.

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

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
  • viewed: 1035
Share:
1 Reply
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.

Similar topics

reply views Thread by Nelgonde | last post: by
5 posts views Thread by Ryan Waye | last post: by
1 post views Thread by Tomomichi Amano | last post: by
6 posts views Thread by NuB | last post: by
232 posts views Thread by robert maas, see http://tinyurl.com/uh3t | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.