PDA

View Full Version : Combo/Text Box Value



JuanDelaCruz
08-05-2005, 12:14 PM
Hi,

I am trying to influence the default value on certain combo box or text box by another input on other combo box or text box. So that I can minimize the need to select value on some combo box or text box. Anybody has a simple code to accomplish this?

Thanks,
Chris

xCav8r
08-05-2005, 02:08 PM
:hi:


Create an event procedure that fires when a control's value is updated, then do something like this:

Me.Control1.Value = Me.Control2.Value

or...

Me.Control1.Value = "custom string"

JuanDelaCruz
08-09-2005, 09:22 AM
The .Value does not work when I used the result of a query, so I was forced to use .Rowsource and it does not resolve my problem.

Me!Longtitude.RowSource = "qryLongtitude"

xCav8r
08-09-2005, 05:23 PM
Can you be more specific about what you're trying to do then? Maybe I can help if I have more details. :)

JuanDelaCruz
08-10-2005, 06:19 AM
Suppose I have three combo boxes. The moment I choose the form that contains them, it will automatically display default values on all combo boxes. Now, when I choose the right value for the first one the other two will be populated based on what I have choosen on the first one.

The values for these three combo boxes come from dynamic queries which provide values base on certain filters, in this case the specific value selected on the first combo box. I just want to put the result of those queries to the other combo boxes automatically in such a way that I can use the value immediately or the user can view those without any further action.

Thx

xCav8r
08-10-2005, 06:37 PM
Use the .ItemsSelected to get what the user choose from ComboBox1. Then...

ComboBox2.RowSource = "SELECT * FROM tblPeanuts;"
ComboBox2.Requery
ComboBox3.RowSource = "SELECT * FROM tblCashews;"
ComboBox3.Requery

Is this what you were looking for?