Enter info into combo box (automatically) based on criteria

M

Michelle

I have a database that contains a subform. The employee information is the
main form and the employee training information is the subform. Whenever an
employee reaches 100% of their training, I would like their name to be added
as a "trainer" to a combo box in the subform.

On the subform there are 4 squares an employee must achieve before they can
be 100% (or qualified to be a trainer). I have a text box named "Flexiblity
%" and it's a percentage based on the number of squares marked, once the
squares reach 100% I would like the employee name added to the "trainer combo
box" automatically. I have a text box on the subform linking the employee
name (but it's not visible). It's called "=Forms![Michelle Employee Main
Form]!Employee"

I've been reading about recordsets and SELECT statements but queries have
always been confusing to me.

Any help would be appreciated.
 
S

Steve

As a start, you don't "add" data to a combobox. You add it to a table in
your database that is the rowsource of the combobox or is part of a query
that is the row source of your combobox. You then reqquery the combobox to
make the new data appear in the combobox. Look at the problem from this
perspective and try to find a solution. Post back if you need help.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
D

Douglas J. Steele

You most certainly can add data to a combo box.

There are 4 ways that a combo box can be populated, controlled by the
RowSourceType property:

Table/Query: the data is from the table, query or SQL statement specified by
the RowSource property.
Value List: the data comes from the semicolon-delimited list specified by
the RowSource property
Field List: the data is a list of fields from the table, query or SQL
statement specified by the RowSource property
Function Name: the data comes from a user-defined function using a very
specifically defined set of parameters

When the RowSourceType is Value List, you can use the AddItem method of the
combo box to add new data.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Steve said:
As a start, you don't "add" data to a combobox. You add it to a table in
your database that is the rowsource of the combobox or is part of a query
that is the row source of your combobox. You then reqquery the combobox to
make the new data appear in the combobox. Look at the problem from this
perspective and try to find a solution. Post back if you need help.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)




Michelle said:
I have a database that contains a subform. The employee information is
the
main form and the employee training information is the subform. Whenever
an
employee reaches 100% of their training, I would like their name to be
added
as a "trainer" to a combo box in the subform.

On the subform there are 4 squares an employee must achieve before they
can
be 100% (or qualified to be a trainer). I have a text box named
"Flexiblity
%" and it's a percentage based on the number of squares marked, once the
squares reach 100% I would like the employee name added to the "trainer
combo
box" automatically. I have a text box on the subform linking the
employee
name (but it's not visible). It's called "=Forms![Michelle Employee Main
Form]!Employee"

I've been reading about recordsets and SELECT statements but queries have
always been confusing to me.

Any help would be appreciated.
 

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