Results 1 to 3 of 3
  1. #1
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169

    Confused on how to go about coding this form

    I have a form that contains 7 combo boxes and 3 list boxes. Each connect to a main table in my database and I have queries for each. For example the first combo box is for the year of the main table and it looks like this:



    select year_table.yr from year_table inner join main on year_table.yr_id = main.yr_id group by year_table.yr;

    So all the year information would be displayed in that combox box and the end-user has the option to select 1 or more. The end-user can do this for all the 10 items above. Then I created a run results button and when that button is selected by the end-user, I want whatever was placed in the 10 above items to search in the main table and display the results based on what they asked for.

    Example:

    combo boxes: year, month, name, address, city, state, zip
    list boxes: item, item desc, quantity

    The main table houses for example yr_id, mth_id, name_id, address_id, city_id, state_id, zip_id, item_id, item_q_id and these ids have a relationship with the corresponding tables.

    So say an end-user selects 2013, jan, john doe, 1111 stage street, ny, ny, 10090, skirt, blue skirt with leather belt, 4

    I want my button to beable to display what was selected. Or if they leave something blank. Say they just put in 2013, jan, john doe and nothing else and want to see a display of all that john doe selected. I am thinking I need a query but just not sure how to go about it.

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Then bind the fields to the combo Column.
    Example: Under Control Source, =cboYourComboBox.Column(1)

    HTH

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I see a problem with
    select year_table.yr from year_table inner join main on year_table.yr_id = main.yr_id group by year_table.yr;

    This, by itself, is not very informative. It not being informative is probably why you feel you need a button for the user to click and get more info. I see two options to make a RowSource like this more functional.

    Include additional fields in the SELECT statement

    and or

    Include a WHERE clause or HAVING clause in the RowSource so the combo is dependent on other criteria displayed on the form.

    The trend to these options is to display or communicate more information before and or as the user interacts with the combo.

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

Similar Threads

  1. Replies: 3
    Last Post: 03-30-2012, 02:02 PM
  2. Split Form Orientation...Coding?
    By tylerg11 in forum Forms
    Replies: 3
    Last Post: 12-21-2011, 02:25 PM
  3. Confused about lookup in table v form
    By jray7000 in forum Access
    Replies: 3
    Last Post: 08-23-2010, 03:36 PM
  4. Filter by Form? Confused...
    By andmunn in forum Forms
    Replies: 0
    Last Post: 01-14-2010, 01:30 PM
  5. simple math coding for form field??
    By RCBNewbee in forum Programming
    Replies: 7
    Last Post: 07-13-2009, 08:30 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