Results 1 to 8 of 8
  1. #1
    clarkej is offline Novice
    Windows XP Access 97
    Join Date
    Nov 2010
    Posts
    12

    Query results to form

    hi im sorry if this has been answered somewhere already but i looked though a few pages and couldn't find anything that helped.



    i have designed a database which shows results of a query in a List box in a form, the idea is that when the user selects a name the full info opens up in a new form allowing for data entry.

    the problem is when i chick on the three test entries (37, 38 % 39) i have the select form, it always open up with the first one each time (37).

    i have the command

    Private Sub Lista20_Click()

    DoCmd.OpenForm "Sales Form", , , "[leadID]=" & Me![leadID]

    End Sub

    if anyone can help me i would appricate it, ben bugging me for a few days now

    Jay

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If the listbox is multiselect, you can't refer to the listbox like that. If it's single select, that should work providing the value is numeric. What is the multiselect property of the listbox?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    besides, the form "Sales Form" must have filteron=true

  4. #4
    clarkej is offline Novice
    Windows XP Access 97
    Join Date
    Nov 2010
    Posts
    12
    hey thanks for getting back to me unfortunally neither of those worked

    i have up loaded screen prints of the properties of both the list box and the form.

    this is my first time i've used access to do a database, (not to mention im having to use access 97) hope the screen prints help im guessing microsoft changed a few well things with later versions

    J

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Does this work?

    DoCmd.OpenForm "Sales Form", , , "[leadID]=" & Me.Lista20
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    clarkej is offline Novice
    Windows XP Access 97
    Join Date
    Nov 2010
    Posts
    12
    hey thanks for your help guys,

    but i decided to cut my losses and re built the whole thing over the weekend, and it works now, no idea what is different but their must be something thanks again

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Glad you got it sorted out; sorry it had to be "the hard way". Welcome to the site by the way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    clarkej is offline Novice
    Windows XP Access 97
    Join Date
    Nov 2010
    Posts
    12
    Quote Originally Posted by pbaldy View Post
    Glad you got it sorted out; sorry it had to be "the hard way". Welcome to the site by the way.

    thanks for the welcome, im sure i'll be picking brains over the next few weeks and as for the hard way, i dont really care so long as it works lol

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

Similar Threads

  1. Replies: 6
    Last Post: 05-14-2012, 07:24 AM
  2. Use a form to tailor query results
    By thekruser in forum Queries
    Replies: 9
    Last Post: 09-23-2010, 04:54 PM
  3. Display Query Results on a Form
    By P5C768 in forum Queries
    Replies: 5
    Last Post: 05-04-2010, 11:04 AM
  4. display query results in a form
    By P5C768 in forum Queries
    Replies: 3
    Last Post: 08-14-2009, 03:02 PM
  5. Entering query results in a form
    By marcello.dolcini in forum Forms
    Replies: 0
    Last Post: 04-15-2007, 06:01 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