Results 1 to 6 of 6
  1. #1
    jennyaccord is offline Novice
    Windows XP Access 2002
    Join Date
    Dec 2009
    Posts
    5

    Combo Box - Field List Values

    I have a form that is huge, but that needs to remain on a single page, i.e. the management don't want to have to scroll down or across for more information. They don't want the form splitting up, or information moving to other forms because, well, they just don't (don't ask, they're simply stuck in their ways and are all technophobes. If they could get away with using a pad and pencil for everything they would).

    I'd like to give myself a bit of breathing space on the form and was wondering if the following is possible.

    I know that I can create a combo box with a list of field names in it, but can I link this to a text box so that anything that is written or displayed within it relates to the field displayed in the combo box? So, if I chose Meeting Date from the field list the text box would display the meeting date, or would remain blank for me to type the date into, and if I then chose Shipping Number from the field list the Meeting Date would disappear and the Shipping Number would appear.

    Did that make sense? If it did, is it possible?

    I know that you can link boxes to display information dependent on an entry in a certain box, e.g. Choosing a clients name would bring up a telephone number and address in the relevant boxes, but can it be done with a field list?



    Thanks

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Would using a TabControl be acceptable for your form? I'm not sure I understand your question.

  3. #3
    jennyaccord is offline Novice
    Windows XP Access 2002
    Join Date
    Dec 2009
    Posts
    5
    Didn't think it made a lot of sense. I'm not particularly database savvy, and I'm learning as I go along, so I apologise if I'm asking stupid or nonsensical questions. I'll try and explain in more detail.

    OK, let's say I have a simple database that contains basic information about people and their pets. The database is comprised of 2 tables. The first table is called Humans and has the following fields:

    IDno.
    Name
    Age
    Hair Colour

    The second table, called Animal has 3 fields:

    IDno.
    Pet
    Pets Name

    I create a query amalgamating the information from the two tables, the relationship between them being the IDno.

    What I'd like to know is, if I create a form for this information, would it be feasible/possible to create a combo box with the field headers in it from the Animals table and have a linked text box display the relevant information for that record when one of the fields is chosen.

    The form would look something like this:

    IDno: [Autonumber]
    Name: [space for text]
    Age: [space for number]
    Hair Colour: [space for text]
    Pet info: [Combo box] [text box]

    So if record 1 was for a chap called Steven, aged 30, blonde with a dog called Rover, the relevant information for the human would be displayed (when I navigate to that record), and the Pet Info displayed in the text box would be dependent on the field chosen in the combo box (if I chose Pet from the field list the text box would say Dog. If I chose Pet Name the text box would say Rover).

    Did that make it any clearer, or muddier than hell?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So the IDno in the Animal table is actually a ForeignKey of the PrimaryKey from the Human table? If so then you can create a query that joins the two tables on that field.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm sorry but in re-reading my last post it may not be too helpful. When you join two tables in a query, it is as if all of the fields in *both* tables are in one table. In your example, it would make more sense to me that the Animal table IDno was the PrimaryKey (PK) of that table and an additional field in the Human table called say Pet was a ForeignKey (FK) into the Animal table. You could then change the FK and all of the other values for the fields in the Animal table would just magically change in the query.

  6. #6
    mkblack is offline Novice
    Windows 2K Access 97
    Join Date
    Jul 2011
    Posts
    16

    question

    Jennyaccord, have you ever received a solution for this issue? I am having the exact same need.

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

Similar Threads

  1. Checking List Box Value with Combo box selection
    By empyrean in forum Programming
    Replies: 1
    Last Post: 10-23-2009, 06:01 PM
  2. Replies: 1
    Last Post: 08-26-2009, 10:45 AM
  3. Replies: 3
    Last Post: 02-26-2009, 10:17 AM
  4. Replies: 0
    Last Post: 12-19-2006, 09:44 PM
  5. Replies: 1
    Last Post: 03-09-2006, 12:12 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