Control Button or Check Box Question (1 Viewer)

Hydra427

Registered User.
Local time
Today, 17:10
Joined
Mar 9, 2012
Messages
40
First let me give you a little synopsis of what I am trying to accomplish. I am fairly new to VBA code and need some help.

I have a form "Cars" that I enter information about my collection into. On that form is a text box for "box type". As I am entering data into my Cars form when I tab to the "box type" I want a new form to open "boxes" showing all the available boxes. When I select the box that, that model is associated with, I want that form (boxes) to close and insert a specific value into the text box "box type" on the cars form. I should then be able to proceed to the next text box on the "Cars" form that would allow me to enter the condition of that box.

Any help anyone can give me would be greatly appreciated!

Thanks in advance, John
 

missinglinq

AWF VIP
Local time
Today, 17:10
Joined
Jun 20, 2003
Messages
6,423
Rather than opening a second Form for this kind of thing, you should use a Combobox. The Combobox Wizard will walk you through the creation of it.

The RowSource of the Combobox can either be a Value List (select I will type the values that I want) or a Table (select I want the combobox to look up values in a Table/Query). Which you choose depends on how likely the Items/Selctions in the Combobox are to change.

If this is apt to remain static, use the Value List, If, in the future, you need to add an item, you'll have to go back into the code and modify the RowSource Value List.

If the Items/Selctions are apt to change on a regular basis, base the Combobox on a small Table whose purpose is to simply list these items. Anytime you need to add or change an item you can simply do it thru the Table rather than having to go back into the underlying code of your Cars Form.

In Form Design View, select the Combobox then go to Properties-Data and set the Control Source to the Field in your underlying Cars Table that you want to hold the Box Type.

Now, in the code module for the Cars Form use this code
Code:
Private Sub ComboboxName_Enter()
 ComboboxName.Dropdown
End Sub
Now, when you move into the Body Type Combobox, the list will automatically dropdown.

Linq ;0)>
 

Hydra427

Registered User.
Local time
Today, 17:10
Joined
Mar 9, 2012
Messages
40
Thanks Linq, I already have this set up as a combo box and am trying to make it a little fancier with a pop up showing pictures of the boxes that I could easily select. There are about 25 different boxes and having them pictured would make it so much nicer.
 

Users who are viewing this thread

Top Bottom