Command Button to Add Several Records

N

NFL

First of all, thank you for all of your inputs on this forum. It has been
very helpful and I learned a lot.

I have a form (Main) and a Subform (Requirements). The Main form has
employee information and each one has departments assigned to (1 employee &
many depts). I already have the subform setup where you can "manually" add
individual requirements and fill other related data. I also have a a
separate table created with requirements based on assigned departments.

What I would like to do is to create a command button (with If Then
conditions). The condition would be if an employee is assigned to "such and
such" dept then add one record in only one field AND then create another
record on the same named field ... and so on. Once the records are created
then a user can view the requirements and manually complete the other fields.
If this can be done, would the command button be placed on the main form or
sub form.

I was able to create a separate form based on a query to view the
requirements, but not able to go any further with that.

Thank you,
 
M

Mike Painter

NFL said:
First of all, thank you for all of your inputs on this forum. It has
been very helpful and I learned a lot.

I have a form (Main) and a Subform (Requirements). The Main form has
employee information and each one has departments assigned to (1
employee & many depts). I already have the subform setup where you
can "manually" add individual requirements and fill other related
data. I also have a a separate table created with requirements based
on assigned departments.

What I would like to do is to create a command button (with If Then
conditions). The condition would be if an employee is assigned to
"such and such" dept then add one record in only one field AND then
create another record on the same named field ... and so on. Once
the records are created then a user can view the requirements and
manually complete the other fields. If this can be done, would the
command button be placed on the main form or sub form.

I was able to create a separate form based on a query to view the
requirements, but not able to go any further with that.

Thank you,

I got lost at,
"one record in only one field AND then create another record on the same
named field "

If you are trying to add an employee to several departments at one time that
can be done with an insert query based on the Employee ID and the
DepartmentID.
I would use a subform which looked like a listbox and add a "Addto"
True/False" field.
Check teh boxes and then update wheter the description = True.
 
N

NFL

Its my fault if I confused you... sorry. I was trying to say that each
record would have several fields. My intention is when I add a record, I
would only focus on one field and then add another record ... and so on.

How do I go about creating an insert query and add a "Addto"?
 
M

Mike Painter

NFL said:
Its my fault if I confused you... sorry. I was trying to say that
each record would have several fields. My intention is when I add a
record, I would only focus on one field and then add another record
... and so on.

How do I go about creating an insert query and add a "Addto"?

"Mike Painter" wrote:

Open the table that contains the fields in design view and add a "yes/no"
field with an approaite name.
Use the query builder to build an append query and set the criteria for
the "Addto" field = True.
 

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