Results 1 to 4 of 4
  1. #1
    dashingirish is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    12

    Manually entering another table's primary key into a form

    I'm working with three tables: tblclient, tblclass, tblstudent.



    tblclient is linked one-to-many to tblclass.
    tblassessment is linked one-to-many to tblstudent.

    I've got three forms: frmclient, frmclass, frmstudent.

    What I'd like is when the client opens frmstudent, he must enter the primary key for a record in tblclass. In this way, the data entered on frmstudent will be linked directly to that specific record on tblclass. What would be ideal is to enable the user to select a clientname/classdate (from tblclient and tblclass, respectively), rather than have to remember what the tblclass PK he wants is, but I'll settle for the latter at this point!

    I can't set up tblstudent as a subform on frmclass because I need to use option groups for some of the fields. It works best if I use a separate form for tblstudent data entry.

    Thanks, in advance, for your help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Why option groups and not comboboxes? I have never used option group for data entry, only to offer options for output procedures (standard filters and reports).

    Try a multi-column combobox for selecting value. However, I don't understand how tblclient influences selecting class.

    Review tutorials at http://datapigtechnologies.com/AccessMain.htm especially the 3 on comboboxes in the Access Forms: Control Basics section.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    dashingirish is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    12
    Thank you for the quick and thoughtful reply. To answer your question, after much deliberation, I chose option boxes because I need to associate a numeric value with text that the user will see. That is the only reason for the option box. It seems to work nicely, so I'm inclined to leave it, though I suppose I could go back to a multi-column combobox.

  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
    Go for the combobox. Set up a standard "lookup" table

    layout along these general lines (whatever your subject matter is) eg Colors
    Code:
    Id........ Value
    1.........Green
    2.........Blue
    3.........Yellow
    4.........Orange

    Your rationale for use of an Option Group is misplaced.

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

Similar Threads

  1. Percent in a table; entering it via a form
    By DecaturLady in forum Access
    Replies: 11
    Last Post: 08-04-2011, 07:16 AM
  2. Replies: 1
    Last Post: 06-15-2011, 03:29 PM
  3. Replies: 1
    Last Post: 05-17-2011, 05:19 AM
  4. Replies: 0
    Last Post: 03-15-2010, 02:38 AM
  5. Replies: 1
    Last Post: 06-01-2009, 01:09 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