Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Location
    Harrow, UK
    Posts
    53

    Unanswered: Simple form lookup - I think

    I'm having trouble setting up what I think should be a very simple form.

    I have a table which has (amongst other things) a field called "Reference" and a field called "Item".

    An Item can have a Reference and a Reference can have several Items i.e. :

    Item Reference

    SAN01 80565
    SAN02 80565
    SAN03 81479
    SAN04 86428
    SAN46 86428
    SPT45 80565

    I want to have a form which is in two halves.

    In the top half, I want to enter the Reference and have it list all the Items.

    In the bottom half, I want to enter the Item and have it display the Reference.

    All help and pointers greatly appreciated.
    Last edited by jamesmc2; 08-27-03 at 11:19.
    Thank you,
    James

  2. #2
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179
    You'll need to create 3 forms, but the end result will look like 1 form.

    Set up the main form with two combo boxes: List of References (near the top), and List of Items (just below the middle)

    Create two subforms based on the table you described showing:
    [list=1][*]Reference (hidden - will link to reference combo box) and Item (visible)[*]Item (hidden - will link to item combo box) and Reference (visible)[/list=1]Put each of these sub-forms beneath the appropriate combo box, setting the "link master field"/"link child field" properties of the subforms to reflect the combo box and the matching hidden field.

  3. #3
    Join Date
    Jul 2003
    Location
    Harrow, UK
    Posts
    53
    Hi - thanks for this, although I don't understand the bits in red.

    Originally posted by JTRockville
    You'll need to create 3 forms, but the end result will look like 1 form.

    Set up the main form with two combo boxes: List of References (near the top), and List of Items (just below the middle)

    Create two subforms based on the table you described showing:
    [list=1][*]Reference (hidden - will link to reference combo box) and Item (visible)[*]Item (hidden - will link to item combo box) and Reference (visible)[/list=1]Put each of these sub-forms beneath the appropriate combo box, setting the "link master field"/"link child field" properties of the subforms to reflect the combo box and the matching hidden field.
    Thank you,
    James

  4. #4
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179
    "will link to X combo box"
    The field needs to be on your sub-form. It's not necessary for it to be visible, because the combo box will show the value of the hidden field.

    "beneath the appropriate combo box"
    Refers to the layout of your main form. You have to use your imagination... but imagine your main form with these controls:

    -----------------
    |combo box 1|
    -----------------

    -----------------
    |sub-form 1 |
    -----------------

    -----------------
    |combo box 2|
    -----------------

    -----------------
    |sub-form 2 |
    -----------------

    "link master field"/"link child field"
    When you put the subforms on your main form, the subform object will have properties (separate from the form properties). Populating the "Link Master Field" and "Link Child Field" properties (on the data tab) as suggested will limit the records shown to just those that match the selection in the combo box.

  5. #5
    Join Date
    Jul 2003
    Location
    Harrow, UK
    Posts
    53
    I'm now completly lost. I'm sure what you are suggesting is a really good solution, but I've got into a absolute mess. Thanks for your help though. I'll try and break it down and start again.
    Thank you,
    James

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •