Results 1 to 4 of 4
  1. #1
    123seven is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2011
    Location
    Aurora, ON Canada
    Posts
    22

    control in subform needs value from control in another subform - on same form

    Hi


    I have a main form with 2 subforms both having a fk of EmployeeID. I'd like to have to only select an employee one time from a combo box on the first form and have the bound integer value copied to the second EmployeeID control on the 2nd subform.

    I've tried, as per this forum the following code in the onload event of the 2nd subform:

    Me!EmployeeID = Forms![frmShowEntries]![subfShowEntriesDetail].Form![cmbEmployee]

    'where [cmbEmployee] is the name of the control, also tried it as [EmployeeID], the field it is bound to...not sure what i'm suppose to reference but in either case I don't get any results in the 2nd form.

    I've also tried the same code in the OnFocus event since i thought maybe the problem was that the subform is already loaded, in either case - nadda.

    Any guidance would be appreciated

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847

  3. #3
    123seven is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2011
    Location
    Aurora, ON Canada
    Posts
    22
    Thank you Orange, but that is exactly where I got the reference logic for what I currently have that doesn't work. I started there with this code:


    Me![EmployeeID] = Me.Parent![subfShowEntriesDetail].Form![EmployeeID] or
    Me![EmployeeID] = Me.Parent![subfShowEntriesDetail].Form![cmbEmployee]

    and got no errors, no changes.

    That's when I checked this forum and tried different versions of suggestions.

    Is the problem syntax or not being called from the right event, or ??

    Thanks, but still help with this...

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    You have a mainForm and 2 subforms -- let's call them subfrm1 and subfrm2.

    Which one does this refer to??
    select an employee one time from a combo box on the first form
    Please describe, using your form names, exactly where you are and what you want to happen.

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

Similar Threads

  1. Hide each control, control group or subform?
    By BRV in forum Programming
    Replies: 2
    Last Post: 12-09-2011, 09:36 AM
  2. Replies: 5
    Last Post: 11-16-2011, 07:30 PM
  3. Replies: 5
    Last Post: 10-13-2011, 03:36 PM
  4. Form/Subform Control
    By Dan Kenton in forum Forms
    Replies: 11
    Last Post: 03-20-2011, 03:55 PM
  5. Subform in a Tab Control on a Main form
    By jpkeller55 in forum Access
    Replies: 4
    Last Post: 01-08-2011, 12:31 PM

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