?
Solved

Automatically selecting in cmb

Posted on 2003-03-10
7
Medium Priority
?
278 Views
Last Modified: 2008-03-10
Hello..

Can anyone tell me how I could have the first (and only) option in a combo box to be selected automatically?
I cannot use DefaultValue because the value in the combo box is made to appear according to a value the user chooses in another combo box.

the first combo is cmb1 ...this is where the user select a value
the second combo is cmb2 ..this is where the only available option in the dropdown is supposed to be selected automatically after something is chosen in cmb1.

OnClick Event for cmb1 is: cmb2.SetFocus
Now i need an OnGotFocus event for cmb2 that would choose the option in the dropdown.

I would have done cmb2.Text = "something" but i cant because the values there are always changing.

So..who's gonna push me in the right direction(or..just take me there perhaps)?

thanks
0
Comment
Question by:badarzaman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 80 total points
ID: 8103450
Try:
Me!cmb2 = Me!cmb2.ItemData(0)
0
 
LVL 2

Expert Comment

by:Loki
ID: 8103673
Your question confuses me.  Why have a combo box if you're only allowing one thing to be selected?  Why couldn't you just derive a value from the first combo box using an if-then-else or case statement in VB?  I guess I don't understand what's taking place after a value is selected in your first combo box.
0
 

Author Comment

by:badarzaman
ID: 8105365
shanesuebsahakarn! That worked great! Thanks.

Loki..actually i have a few cases where 2 values are shown and only then the user is supposed to select one of them.

shanesuebsahakarn...i've seen these Me! thingys before but dont actually know what it is or how it works...can u suggest a page where i'd get this info?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8106315
Well, Me! just means the current form (the one that the code is in), and ItemData(0) means the data in the first row's bound column.

I think the best place to look would be a good Access book. I don't really have any good recommendations on this score, but I'm sure others can recommend good tutorial books that cover most aspects of Access development.
0
 

Author Comment

by:badarzaman
ID: 8111954
okay...i'll be on the lookout for access books!
0
 
LVL 2

Expert Comment

by:Loki
ID: 8112048
The Access 2000 Developers Handbook by Sybex is great.
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8112073
The Dev Handbook is great, but it can be quite daunting if you don't have a grounding in Access already. I would start with something a bit more basic, but the Dev Handbook is an invaluable reference.
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question