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

Copy data from one FORM to another FORM

P: 15
Hi, I am using a form which asks for USER NAME and password. On OK it opens a new FORM in which certain info has to be entered. It also includes USER NAME. i want this field to be populated automaticaly with the USER NAME entered in the privious form. i tried a lot of stuff but was not able to copy the value of previous form field to the field of new form. Urgent help is needed.
Thanks
Aug 18 '06 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Don't close the login form until after the new form has opened.

In the On Load Event of the second form do the following

Me.UserName = Forms("LoginFormName").Controls("UserName")
docmd.close acForm, "LoginFormName"

This will allow you to take the value in the User Name field from the first form before closing it.


Hi, I am using a form which asks for USER NAME and password. On OK it opens a new FORM in which certain info has to be entered. It also includes USER NAME. i want this field to be populated automaticaly with the USER NAME entered in the privious form. i tried a lot of stuff but was not able to copy the value of previous form field to the field of new form. Urgent help is needed.
Thanks
Aug 18 '06 #2

P: 15
Thanks for the Reply. I have already tried this.
It gives the error

Run time error '-2147352567 (80020009)':
You can't assign a value to this object.

What to do next.
Aug 18 '06 #3

P: 15
Thanks for the help. i figure out the problem.
This works.
Me.UserName = Forms("LoginFormName").Controls("UserName")
docmd.close acForm, "LoginFormName"
Thanks again
Aug 18 '06 #4

Post your reply

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