Switch text box to combo box

S

Sandy

I have a form and subform created from the following tables:-

tblRepairCategory
RepairCategoryID (Primary Key - Autonumber)
RepairCategory (Text) - on form main (frmCategory)

tblRepairType
RepairTypeID (Autonumber)
RepairCategoryID (Number - Long)
RepairType (Text) - on form (subfrmRepairType)
BuyPrice (Currency) - on form (subfrmRepairType)
SellPrice (Currency) - on form (subfrmRepairType)

form objects are:-
Main Form - frmCategory
"txtRepairCategory"

Subform - subfrmRepairType
"txtRepairType"
"txtBuyPrice"
"txtSellPrice"

My question is how can I change the text box 'txtRepairCategory' to a Combo
box that would select the correct details on the subform.

Sandy
 
T

Tom Wickerath

Hi Sandy,
My question is how can I change the text box 'txtRepairCategory' to a Combo
box that would select the correct details on the subform.

I'm a bit confused as to what you are looking to accomplish with such a
combo box. Do you want a combo box on the main form to help you locate an
existing record in "tblRepairCategory"? If so, see this article:

Combo box to find a record
http://www.access.qbuilt.com/html/find_a_record.html

However, if you are currently seeing *all* records from "tblRepairType" in
your subform, for any given record in the main form that comes from
"tblRepairCategory", then it sounds to me like you do not have this set up
correctly. If this is so, check the Link Master Field / Link Child Field
properties for the subform control. This is the control that holds your
subform, not the subform itself. You want the Link Master Field to specify
the primary key for tblRepairCategory (ie. RepairCategoryID), and the Link
Child Field to specify the foreign key for tblRepairType (also
RepairCategoryID). You must make these fields available in the recordsource
for each form. In addition, you'll want to make the primary key fields
available in each form. For the subform in datasheet view, you can suppress
viewing these two key fields by moving them from the Detail section to the
Form Header section. The order that the fields appear in the subform is
controlled by the Tab Order that you set.

Note:
You must first create a form (use datasheet view as the default) to display
the records from "tblRepairType". Then add this as a subform to your main
form. If you currently see a named table as the subform, then this will not
work.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
S

Sandy

Ah Tom

I have two situations, the first being a form to input customer requirements
hence the combo box you helped me with already, and the second, a form to
input the actual repair details to be made available in the first form combo
box - if you see what I mean.

In the second case a combo box on the main form in order to select All the
fields in the subform pertaining to that section e.g. Grips. The idea being
that the list of grips can be checked prior to entering any new product.

With the information you have supplied I now have two forms with two
perfectly operating filter combo boxes.

I hope that explains it all..

(I felt a bit guilty about hoarding your time on the last posting that is
why I started a new one).

Sandy
 
T

Tom Wickerath

Hi Sandy,
...and the second, a form to
input the actual repair details to be made available in the first form combo
box - if you see what I mean.

To be honest, I really don't see what you mean here. Is there any way that
you can send me a test database, with dummy records in place of any sensitive
data, so that I can see what you are attempting to describe? If so, please
compact the test database (Tools | Database Utilities | Compact and repair
database ---> Access 2003 and earlier), and add it to a .zip archive file, if
possible.

If you are interested, send me a private e-mail message with a valid
reply-to address, that includes your .zip file (or the .mdb file, if you
cannot zip it). My e-mail address is available at the bottom of the
contributor's page indicated below. Please do not post your e-mail address
(or mine) to a newsgroup reply. Doing so will only attract the unwanted
attention of spammers.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top