Code for Combo Box and Tab Control

slrphd

Registered User.
Local time
Today, 18:22
Joined
Jan 6, 2004
Messages
91
SLR Question to Ukraine82 re: tab control and combo box:

I read your post of 26 Aug 04 and it sounds like I have a similar problem. I thought I would ask for your help directly because I do not understand the solution you found. First, the problem:

I have a database containing a large amount of information about power plants (I am a consultant to DOE). I want to recall various categories of information about each plant in a form. My plan is to use a combo box to provide a picklist of plants. There are five categories of information about each plant so I have a tab control with five pages. I have written a query to recall specific information about each: one query for each information category. How do I get the output of the query to appear on the tab control page that corresponds to the plant selected in the combo box?

I saw your solution and must confess that I do not understand the code. I use three basic references in my work: (1) "Using Access 97" even though I am working in Access 2000, (2) "Access 2000 Programming for Dummies," and (3) "Microsoft Access VBA Programming for the Absolute Beginner." You probably can guess from the titles what my skill level is. I am a neophyte and have not gotten into writing code very deeply or gained much experience. Could you provide a few sentences about the implementation of your code? I shall be forever grateful and name my first child after you. Thanks.
 
I'm not sure if you got my private message earlier. If not, try these steps below.

Make sure you make a form from your query or table. Add all your fields in a form. Now to cascade combo box you have 2 ways of doing it.

Make a blank combo box....

Set your Row Source Type = Table/Query
Row Source = SELECT [TableName].[FieldName] FROM [TableName];

Use code below on After_Update.

Me.RecordsetClone.Findfirst "[FieldName] = " & Me![ComboBoxName]
Me.Bookmark = Me.RecordSetClone.Bookmark

or

You can use a combo box wizard. If so, you should get a pop up with 3 options to choose from(radio button). Select Find a record on my form based.....

Say next...Select a field that you wish to have in a drop down box that will do the search for you.

Say next..next..Finish.

Try it out.

hth,

Michael
 
What about the tab control?

Michael,
I did get your message and thanks for that. I think I understand what you have told me but I do not understand how this works with the tab control. I must not have provided enough detail. My idea was to have a combo box from which the user chooses the plant name. Below the combo box is a tab control with five pages, one for each information category. I wanted the user to be able to first, select a plant, and then, second, click a tab to choose an information type. The tab control page presents the information.

So, what do I need to do? Should I make a single query with all five information types, build the form, and then click and drag all the fields for a particular information type to that page of the tab control? Is it that simple or am I just too dense? Don't answer that last part.

SLR
 
New Agents zip file

Michael,
I have reviewed the database you shared with me so generously and it has exactly the behavior I am looking for. Thank you. I need to work backward through your setup but I believe I know enough to do that profitably. My wife had a baby girl last week and she agreed that we should name her Ukraine82. Thanks, again.
SLR
 

Users who are viewing this thread

Back
Top Bottom