Results 1 to 5 of 5
  1. #1
    Dominaz is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    21

    Conditions refered to value of list box

    Hello again,
    I've a doubt of how to make where conditions refering to the value of a list box in a form, I'm going to explain it:



    I've a form which show me information about bookings (name, date,etc) which is stored at table_bookings ,I have other table with information of my clients, the point is I want a form where I can select a name of one client, and edit the booking details.

    How can I do that???


    Thanks.

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    It sounds as if your form is based directly on one table.

    To get the result you want, you should create a query based on both tables and linked by name (runner id?). In the design view. put a runner's id in the criteria field, run the query and you should come up with most of the info which you need. Remove the criteria and save the query.
    Then recreate your form based on the query.
    At this point, you will probably want to have some means of either entering a runner's id and pulling up a name. If you get stuck, repost.

  3. #3
    Dominaz is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    21
    Quote Originally Posted by hertfordkc View Post
    To get the result you want, you should create a query based on both tables and linked by name (runner id?). In the design view. put a runner's id in the criteria field, run the query and you should come up with most of the info which you need. Remove the criteria and save the query.
    Then recreate your form based on the query.
    At this point, you will probably want to have some means of either entering a runner's id and pulling up a name. If you get stuck, repost.
    I've done what you said, but When I open the form it filter the data with the name I put on Query criteria, and I still don't know how to do a filter so in the form I only see the data related to for example one name..

  4. #4
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    You overlooked one step

    Quote Originally Posted by Dominaz View Post
    I've done what you said, but When I open the form it filter the data with the name I put on Query criteria, and I still don't know how to do a filter so in the form I only see the data related to for example one name..
    You've formed the query correctly and it filters correctly. Note that I said
    Remove the criteria and save the query.

    Let me restate: Open the criteria in design view and remove the runner Id which you saved with the query. After you have removed the runner Id from the query, save it.
    Open your form. You should now see the unfiltered results.

    If this works, then you are ready to create the filter from the form.
    I use brute force to link the box on the form to the filter. From whatever control that you are selecting/entering the runner ID, construct onevent (onclick, onupdate) code that inserts the runnerid into the filter and forces a requery.

    See example here: https://www.accessforums.net/forms/f...xes-18492.html
    oops. That is Access 2007. I'll try to find a 2003 link and repost.
    Last edited by hertfordkc; 11-03-2011 at 04:55 AM. Reason: wrong version of access

  5. #5
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    Here is a linking example in Access 2000

    This link contains an example "db2 Mod" which should help you. Be sure to examine the objects and properties in design view, and also view any visual basic code.

    https://www.accessforums.net/forms/c...lds-18541.html

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

Similar Threads

  1. Forms and Conditions
    By jlgray0127 in forum Forms
    Replies: 11
    Last Post: 11-02-2011, 02:55 PM
  2. a Question about conditions in access
    By fedesc in forum Access
    Replies: 12
    Last Post: 10-03-2011, 07:25 AM
  3. Sum Column with conditions
    By g8rnc in forum Access
    Replies: 1
    Last Post: 06-10-2010, 09:59 AM
  4. if...then conditions ???
    By em07189 in forum Access
    Replies: 6
    Last Post: 03-05-2010, 10:29 PM
  5. Conditions / Expressions
    By Mark344 in forum Access
    Replies: 1
    Last Post: 02-19-2010, 08:15 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