Results 1 to 3 of 3
  1. #1
    MIEUCHRE is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    2

    Copy a field from a main form to a secondary form that is selected from the main form

    I have a main form [Employee Work Form] that contains a field that is an identification number of the employee using the form. They must enter that number to open the form and it is placed in a field [HRMN] on that form. From there the employee can select 1 of three other forms they will need to fill out. I want the [HRMN] field to carry over into the [HRMN NO] field on any of these three forms they open. I understand I will have to work on each form seperately but if I can get one to work I can get the other two to work. One form is [Employee New CPS Entry Form]. I have tried several things and cannot get that number to be copied to the second form. Here is an example of the code I used for an event procedure on the second form upon open:



    DoCmd.OpenForm "Employee Work Frm", acNormal
    DoCmd.GoToRecord , , acNewRec
    Forms![Employee Work Frm].[HRMN].Value = Me.[Hrmn No]

    Nothing happens.

    I have tried this in the on click field of the second form:

    Forms![Employee Work Frm].[HRMN].Value = Me.[HRMN NO]

    I get a message access cannot find the form 'Employee work Frm'. Can someone help me I am running out of options and time.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Try:
    DoCmd.OpenForm "Employee Work Frm", , , , , , Me.HRMN
    to open the new form. In the forms On Open or On Load event try
    Me.HRMN = Me.OpenArgs
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    MIEUCHRE is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    2
    I finally got it to work by using the default value field.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. copy from popup form to main form
    By alex_raju in forum Forms
    Replies: 2
    Last Post: 02-10-2012, 05:29 PM
  2. Replies: 12
    Last Post: 01-18-2012, 10:02 AM
  3. copy data from a subform to the main form
    By declanfogarty in forum Programming
    Replies: 1
    Last Post: 06-23-2011, 05:31 AM
  4. Replies: 1
    Last Post: 10-13-2010, 12:40 PM
  5. copy info in subform as well as main form
    By Coolpapabell in forum Forms
    Replies: 0
    Last Post: 09-30-2009, 10:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums