Tags: access, asks, certain, copy, database, entered, form, includes, microsoft, mysql, opens, oracle, password, sql, user

Copy data from one FORM to another FORM

On Database » Microsoft Access

1,755 words with 3 Comments; publish: Thu, 03 Jan 2008 11:38:00 GMT; (25058.59, « »)

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

All Comments

Leave a comment...

  • 3 Comments
    • 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.

      Quote:
      === Original Words ===

      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

      #1; Thu, 03 Jan 2008 11:39:00 GMT
    • 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.

      #2; Thu, 03 Jan 2008 11:40:00 GMT
    • Thanks for the help. i figure out the problem.

      This works.

      Me.UserName = Forms("LoginFormName").Controls("UserName")

      docmd.close acForm, "LoginFormName"

      Thanks again

      #3; Thu, 03 Jan 2008 11:41:00 GMT