Closed Thread
Results 1 to 5 of 5

Thread: populate combobox from another

  1. #1
    Barn Newbie Jaykappy is an unknown quantity at this point Jaykappy's Avatar
    Join Date
    Apr 2008
    Posts
    21
    Rep Power
    3

    populate combobox from another

    I am trying to ge this to work adn not having any luck

    What I have is a form with a Dropdown box (Combo85). This is hard coded with field names from a table I have (Table is dbo_Core2).

    What I am trying to do Is populate another dropdown box (Combo89) with the unique values from the field choosen in the first Dropdown box (Combo85)

    So I get the field name from the variable I set up and try and put in this query string and I am getting errors...dosent like the Me.Value...I think there are other problems but cant find them

    Any thoughts?

    Thanks

    Code:
    Private Sub Combo89_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    Dim varFieldType As String
    varFieldType = Combo85
    MsgBox varFieldType
    
    Dim MySQL As String
    'MySQL = ""
    
    'MySQL = dlookup("[varFieldType]", "dbo_Core2", "CriteriaField = " me.Value)
    
    'MsgBox MySQL
    
    'DoCmd.RunSQL MySQL
    
    End Sub
    

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    What errors do you get?
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  3. #3
    Barn Newbie Jaykappy is an unknown quantity at this point Jaykappy's Avatar
    Join Date
    Apr 2008
    Posts
    21
    Rep Power
    3

    First off I think I am going about this wrong...maybe you can help...

    I am not trying to return values from A field based on another fields value.

    I am trying to build a form...and on that form I have a drop down box with the field names from a table.

    I want the user to select a field name
    When they select a field name it goes to the table, selectes all the unique values from that field and populates them in a second Dropdown box.

    They then will select a specific attribute value...

    From there I will run a few queries....I just cant figure out how to populate that second dropdown box with the unique values from the specific Field (that was choosen in the First Dropdown box)

    That make any sense?


    Thats for your help....very appreciated..

  4. #4
    Lightning Master AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123's Avatar
    Join Date
    Mar 2008
    Location
    Fortress Of Solitude
    Posts
    221
    Rep Power
    6

    I'd forget using the domain aggregates,. they're pretty slow,..

    Take a look at my sample,.. no queries,.

    This should be exactly what your after

    Thanks AOG
    Attached Files
    If i helped you, make me famous by clicking the

  5. #5
    Barn Newbie Jaykappy is an unknown quantity at this point Jaykappy's Avatar
    Join Date
    Apr 2008
    Posts
    21
    Rep Power
    3

    AOG123

    Exactly what I was looking for....

Closed 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

SEO by vBSEO