Auto Copy

  • Thread starter Thread starter FDLCVB
  • Start date Start date
F

FDLCVB

I am creating a database for admission tickets. The tickets need to be
numbered, so I set up an autonumber field and assigned it the Primary Key. I
also have a date and time field.

My question is...if I enter 1 record for an admission ticket on 3/27/08 at
5:30 p.m. I need 40 more tickets for this same day and time, only numbered
consecutively. Is there a way to tell Access to create 40 more records for
the same date and time? Other than hitting Control ' for each field and
record?
 
FDLCVB,

Yes. The bare bones of this would be:

1. Create a table with just one field, Number data type, and enter
numbers 1=>whatever is the maximum number of tickets you imagine you
would ever need to issue in one hit.
2. Make a query that includes this table, along with the tickets table,
with no joins between them.
3. In this query, set a criteria to the current record in your form.
4. On your form, put an unbound textbox for the user to enter the
number of tickets required.
5. Again in the query, enter a Criteria for the number field in the new
numbers table, using syntax something like:
<=[Forms]![NameOfForm]![NameOfTicketNumbersTextbox]
6. Make this query into an Append Query (select Append from the Query
menu), and nominate the tickets table as the destination.
7. Use an OpenQuery action in your macro to run this append query, and
assign this macro to a suitable event on the form, such as the Click
event of a command button on the form.
 
I'll try it. Thank you for your help!

Steve Schapel said:
FDLCVB,

Yes. The bare bones of this would be:

1. Create a table with just one field, Number data type, and enter
numbers 1=>whatever is the maximum number of tickets you imagine you
would ever need to issue in one hit.
2. Make a query that includes this table, along with the tickets table,
with no joins between them.
3. In this query, set a criteria to the current record in your form.
4. On your form, put an unbound textbox for the user to enter the
number of tickets required.
5. Again in the query, enter a Criteria for the number field in the new
numbers table, using syntax something like:
<=[Forms]![NameOfForm]![NameOfTicketNumbersTextbox]
6. Make this query into an Append Query (select Append from the Query
menu), and nominate the tickets table as the destination.
7. Use an OpenQuery action in your macro to run this append query, and
assign this macro to a suitable event on the form, such as the Click
event of a command button on the form.

--
Steve Schapel, Microsoft Access MVP
I am creating a database for admission tickets. The tickets need to be
numbered, so I set up an autonumber field and assigned it the Primary Key. I
also have a date and time field.

My question is...if I enter 1 record for an admission ticket on 3/27/08 at
5:30 p.m. I need 40 more tickets for this same day and time, only numbered
consecutively. Is there a way to tell Access to create 40 more records for
the same date and time? Other than hitting Control ' for each field and
record?
 
Back
Top