Results 1 to 4 of 4
  1. #1
    recon2011 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    28

    Filling controls on two forms


    I have two forms that require a case number to be entered for new projects. One form is a time card form and the other is a project form. Right now when I open a new project I have both forms open one on top of the other. When I enter the case number on the time card form I need the case number to automatically fill in on the projects form. The forms have different tables but relationships have been established.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If the field you're talking about is the same field you're using for the parent/child relationship is there a reason you're not using a form/subform. If you set it up this way you wouldn't have to 'copy' anything the child record would automatically inherit the field from the parent.

  3. #3
    recon2011 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    28
    The Projects form has a subform for time cards that shows limited data. But the TimeCard form itself needs to open from the Projects form in order for people to enter their daily activities. But when a new project is started, there is no link between the Projects form and the TimeCard form until the case number has been entered. (Both forms are linked through the casenumber field/control) After the project and time card are initially entered, the time card form can be activated through the project form and the casenumber field/control is automatically populated. It's only on the initial entry of a new record that I need addressed. Thanks for your help.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Without an example database I don't really follow your data structure. However, the easiest thing to do would be to pass a variable from one form to the other when you open the secondary form. If you set an unbound field (set the visible property to false after you get it working) to the value of the previous form's parent unique key. Then whenever a new record is added to the secondary form you can have some code running that will force the foreign key to be equal to the unbound text box with something like:

    me.fieldname = me.unboundfieldname

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

Similar Threads

  1. Replies: 1
    Last Post: 06-24-2011, 04:27 PM
  2. Filling in Fields
    By BigCat in forum Access
    Replies: 2
    Last Post: 05-19-2011, 02:02 PM
  3. Replies: 13
    Last Post: 01-27-2011, 11:12 AM
  4. Is there a way to do a query by filling in a from?
    By newtoAccess in forum Queries
    Replies: 6
    Last Post: 11-30-2010, 06:05 PM
  5. Auto Filling
    By tgavin in forum Forms
    Replies: 2
    Last Post: 08-02-2010, 10:47 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