Go Back   DeveloperBarn Forums > Databases > Microsoft Access

Sponsored Links

Discuss "populate combobox from another" in the Microsoft Access forum.

Microsoft Access - Microsoft Access is a database for small to medium applications. Learn tips and tricks and best database practices here.


Closed Thread « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old May 7th, 2008, 12:15 PM
Barn Newbie
 
Join Date: Apr 2008
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 1
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
Sponsored Links
  #2  
Old May 7th, 2008, 01:24 PM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 817
Thanks: 20
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft SQL Server Microsoft Windows Microsoft .Net Classic ASP 
Total Awards: 4

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.

Join our Folding team: DeveloperBarn Folding
  #3  
Old May 7th, 2008, 01:51 PM
Barn Newbie
 
Join Date: Apr 2008
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 1
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: 93
Thanks: 6
Thanked 23 Times in 18 Posts
Rep Power: 1
AOG123 is on a distinguished road

Awards Showcase
Microsoft Access 
Total Awards: 1

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, 43 views)
__________________
If i helped you, make me famous by clicking the
  #5  
Old May 7th, 2008, 02:56 PM
Barn Newbie
 
Join Date: Apr 2008
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 1
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
Forum Jump


All times are GMT -4. The time now is 01:00 PM.



Content Relevant URLs by vBSEO 3.2.0