dbTalk Databases Forums  

Setting combo values based on first combo selection

comp.databases.ms-access comp.databases.ms-access


Discuss Setting combo values based on first combo selection in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
FrankBooth
 
Posts: n/a

Default Setting combo values based on first combo selection - 07-25-2003 , 01:19 PM






Hello,

Any help on this would be great. I have two combo's, one is an name
selector, the second one is a number selector, but I would like the
second one to automatically set itself to the number that corresponds
to the name selected in the first combo.

The table I'm working with has two fields:

Name Number
-----------
Joe 123
Jim 456


Combo1 is attached to the Name field. Combo2 is attached to the Number
field. When I select Jim in combo1, I want Combo2 to set itself to
456, etc...

This table also has a key ID field if that helps.

Any help is appreciated.

Thanks in advance,
--FB

Reply With Quote
  #2  
Old   
FrankBooth
 
Posts: n/a

Default Re: Setting combo values based on first combo selection - 07-26-2003 , 11:07 AM






Thank you very much. This gets me closer, however it does not work. I
have tried this in different variations: taking the outside quotes out
of the query string, as is, placing in the code module and in the
property table...and it is just not working.

Does my second combo need certain properties set in vertain ways?

Quote:
Me.SecondCombo.RowSource = "SELECT Number FROM MyTable WHERE Name ='" &
Me.FirstCombo & "'"

Reply With Quote
  #3  
Old   
Pavel Romashkin
 
Posts: n/a

Default Re: Setting combo values based on first combo selection - 07-29-2003 , 11:12 AM



Have you replaced control names with your own (Combo1, Combo2)?
Also, we are talking about adding a new record, right? Or changing an
existing record. We are not talking about a form used for searching
records, correct?

Good luck,
Pavel

FrankBooth wrote:
Quote:
Thank you very much. This gets me closer, however it does not work. I
have tried this in different variations: taking the outside quotes out
of the query string, as is, placing in the code module and in the
property table...and it is just not working.

Does my second combo need certain properties set in vertain ways?

Me.SecondCombo.RowSource = "SELECT Number FROM MyTable WHERE Name ='" &
Me.FirstCombo & "'"

Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.