DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

populate combobox from another

This is a discussion on populate combobox from another within the Microsoft Access forums, part of the Databases category; I am trying to ge this to work adn not having any luck What I have is a form with ...

Go Back   DeveloperBarn Forums > Databases > Microsoft Access

  #1  
Old May 7th, 2008, 12:15 PM
Barn Newbie
 
Join Date: Apr 2008
Posts: 21
Rep Power: 2
Jaykappy is an unknown quantity at this point
Default 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  
Old May 7th, 2008, 01:24 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Real name: Jason
Location: Washington, D.C.
Posts: 1,964
Blog Entries: 8
Rep Power: 15
jmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud of
Default

What errors do you get?
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding

  #3  
Old May 7th, 2008, 01:51 PM
Barn Newbie
 
Join Date: Apr 2008
Posts: 21
Rep Power: 2
Jaykappy is an unknown quantity at this point
Default

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  
Old May 7th, 2008, 01:54 PM
AOG123's Avatar
Lightning Master
 
Join Date: Mar 2008
Location: Fortress Of Solitude
Posts: 218
Rep Power: 5
AOG123 is a jewel in the roughAOG123 is a jewel in the roughAOG123 is a jewel in the roughAOG123 is a jewel in the rough
Default

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

Comments on this post
Jaykappy agrees:
Attached Files
File Type: zip db1.zip (12.3 KB, 82 views)
__________________
If i helped you, make me famous by clicking the

Status: Currently Unemployed - Looking for Work, Can be contacted on thethresher@hotmail.co.uk
  #5  
Old May 7th, 2008, 02:56 PM
Barn Newbie
 
Join Date: Apr 2008
Posts: 21
Rep Power: 2
Jaykappy is an unknown quantity at this point
Default

AOG123

Exactly what I was looking for....
Closed Thread

  DeveloperBarn Forums > Databases > Microsoft Access

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:12 PM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2