Results 1 to 6 of 6

Thread: Access - form with a dropdown menu

  1. #1
    Join Date
    Dec 2009
    Posts
    211

    Access - form with a dropdown menu

    Hello,
    I want to make a form with a dropdown menu in access that lets you choose the name of a customer and execute a query by clicking a button.
    So I made my list, my button, the button's click event I put this, here is part of the code.
    Private Sub Commande5_Click()
    Sun stdcnm As String

    stdcnm = "Query tracks customer"
    DoCmd.OpenQuery stdcnm, acNormal, acEdit
    End Sub
    And I modified the test case of my request at the Customer name and I added this to my code.
    [forms]![Form-Client Tracks]![Modifiable2]
    Modifiable2 is the name of my list. So normally my application should run normally when I click on the button and then nothing. In testing it works manually so there's really a problem with the query criteria. I tried coding in the application directly in VBA, but same result (well worse the application does not work when I copied the SQL). In short, a very strange problem that I recall why I quickly stopped using access.

  2. #2
    Join Date
    May 2008
    Posts
    4,570

    Re: Access - form with a dropdown menu

    Hello,
    I think there is a hook in your code, remove the hook Forms. See the code below
    forms![Form-Client Tracks]![Modifiable2]
    Do this and then try to run the program and see if helps you and you are successful with your code, if not post the error you are getting.

  3. #3
    Join Date
    Dec 2009
    Posts
    211

    Re: Access - form with a dropdown menu

    Hello,
    Thank you for your answer but the problem does not come from the users end. I tried with another form and another application and it works very well. So while I started again and it's always the same thing as if the application does not run. So if I open the application and I give it up manually it works. Unfortunately I have to keep blocking.

  4. #4
    Join Date
    May 2008
    Posts
    3,316

    Re: Access - form with a dropdown menu

    Hi,
    Just try the following
    [Form-Client Tracks]
    Note two things here
    I hope that "Form Pieces-Customer" is the name of your form? Is it your sub form, if the you have to change the name of the form. In any case a "Re-query" would be welcome. And re query, I think is good for your code.

  5. #5
    Join Date
    Jan 2008
    Posts
    3,755

    Re: Access - form with a dropdown menu

    Hello,
    If the parameter is a string, then we must put values in both the sides. which gives the code in VBA:
    Me.refresh 'to confirm the selected value in dropdown
    StrReq = "SELECT ... WHERE Value1 = '" & Me![Modifiable2] & "' ;"
    Hope the code helps you, if it is not include in your code, then please include it in your code because it will give you a better performance. If any problem regarding this topic the do ask.

  6. #6
    Join Date
    Dec 2009
    Posts
    211

    Re: Access - form with a dropdown menu

    Hi,
    Ok, I thought it would print some something like that. Well at least I finally find a solution, but it's always nice to know how we really do. But I still think there should be a solution for this, I mean to say a proper solution. By the way thank you for all help me. If someone knows about this or have done it before then please do post your code or any explanation will be helpful to me.

Similar Threads

  1. MS Word 2010 Execute Macros from Dropdown Menu
    By dhaines in forum Windows Software
    Replies: 4
    Last Post: 07-06-2011, 11:00 PM
  2. OS 10.4 Safari Where's the dropdown URL menu
    By Elizabeth Allen in forum Technology & Internet
    Replies: 7
    Last Post: 30-07-2010, 06:07 AM
  3. Explorer 8 for windows dropdown menu problems
    By Longboat in forum Windows Software
    Replies: 3
    Last Post: 13-12-2009, 02:50 AM
  4. Dropdown menu problem
    By Heather5 in forum Software Development
    Replies: 3
    Last Post: 21-11-2009, 09:23 PM
  5. How to create access clear button in the form using MS ACCESS
    By T0tal L0$$ in forum Software Development
    Replies: 3
    Last Post: 09-06-2009, 10:59 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,710,820,650.50256 seconds with 17 queries