Advertisement

04.26.2008 at 02:24PM PDT, ID: 23356255
[x]
Attachment Details

Select default value for bound combo box?

Asked by gnar in Access Forms, Microsoft Access Database, Microsoft Visual Basic.Net

Tags: Microsoft, Access, XP

I'm not much of a MS Access guy, so I may not word this correctly...  Here's the rough situation:

I have a three tables (offices, users, trainings) that look something like this:

Offices:

officeid           officename
1                    Seattle
2                    New York
3                    Tokyo

Users:

userid            username           currentofficeid
1                    Bill                      1
2                    Jim                      1
3                    Peter                  2
4                    Hiro                     3

Trainings:

trainingid       userid            trainedofficeid
1                    1                    1
1                    2                    1
2                    1                    3
2                    2                    1
2                    3                    2


Etc...

And I have a form that has a combobox that selects the user, and another one that controls the trainings.trainedofficeid value (displays values from the offices table and inserts the selected value into the trainings table).  That works great.

What I want to do, though, is have the second combobox default to whatever the users current home office is.  But if you select a different office, the new value should be inserted into the appropriate record in the trainedofficeid field.

Not sure if that makes sense...  The second combobox (the one that selects an office) should be bound to the trainings table in that any change you make to what's selected in that combobox will update the value in the traingings.trainedofficeid field.  But...  I want the default value selected in that combobox to be whatever the user's current office is.

And I can't figure out how to do that.

Thanks.Start Free Trial
[+][-]04.26.2008 at 03:18PM PDT, ID: 21446971

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 04:21PM PDT, ID: 21447110

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 05:13PM PDT, ID: 21447262

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Forms, Microsoft Access Database, Microsoft Visual Basic.Net
Tags: Microsoft, Access, XP
Sign Up Now!
Solution Provided By: harfang
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628