filter a text box through a combo box on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know how to filter the information displaying on a text box
depending on the value of a combo box. Example i have a Combo box with Values
"A", "B", "C", "D". I have a query with fields A B C D where each field is a
calculation to determine extended time (A*Qty, B*Qty, C*qty, D*Qty). If I
pick "A" from my combo box i want it to display the value in that field
pertinent to the current record.

To give you a picture of what i am working on let me describe what i have so
far

I have a Table with 5 fields "strSku" strTimeA" "strTimeB" "strTimeC"
"strTimeD". I have another table that will capture an employee's Work
Production. the table has "strID", "strSku", "strOperation"(where operation
is A, B, C, D) "strQty", "strTime". Both "strSku" are linked (relationship).
I Have a query that displays the strSku and Quantity from my Production table
and 4 calculation fields that determine the values of strTimeA*qty,
strTimeB*qty, strTimeC*qty, strTimeD*qty. On my form i have the fields from
my "Work Production Table" where the Operations field is a Combo box with A,
B, C, D as the values, I would now like to populate the Times text box by the
results of the query where it would look up the value depending on the value
of the combo box. Ex. I pick "C" in my combo box i would like my "Times" Text
field to show "strTimeC*qty" from my query and insert that value into my
Production table strTimes' field for that record. unless there is an easier
way to do this other than by a query.

I hope you guys understand what i am trying to do...I have a very difficult
time explaining myself and i am fairly new to access so i don't know all the
language of it yet.

Thank you for any and all help you can give.
 
You may be able to force your way to a solution in the direction
you're going but you should know that you're using "spreadsheet think"
rather than using the concepts of a relational database.. In
"spreadsheet think" you just add another column for a repeating
attribute and give it a new number or name to differentiate it from
its brethren. In relational "database think" you create a new table
instead and include a record for each attribute actually present for
every parent record in the database. You have the database system
track which records belong to which parent record and it works like
gangbusters.. You don't create an empty record for things not shown.

To try to give an example that might be something like what you're
doing lets assume this application is about something to do with route
management. While there will be other entities we'll start with Rout
being the highest level entity shown and tracked in tblRoute. The
records in tblRoute will have an Autonumber Primary Key and a Route
Name, and Notes about the route.

The depots or stops in the route will have a table, tblStop. tblStop
will have an Autonumber Primary Key, a Long Integer Foreign Key
(foreign key is just the name given a field that holds a copy of the
parent's Primary Key) a stop name, a date/time of entry and notes
about this instance of this route.

To make data entry efficient you'd base a main form on tblRoute and a
subform on tblStop.

If you're just getting started with Access, there's a steep learning
curve and a lot to learn. Once well started you can be incredibly
productive and create applications to help others to be more
productive as well.

I recommend starting with a basic book or two such as Access
[YourVersion] Step-by-Step.from MS Press. There are several useful
Access newsgroups to lurk: tablesdesign, Forms, formscoding, reports,
etc.

HTH
 

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

Back
Top