populating repetitive fields

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

Guest

I have a table with 3 fields in each record that are repeated throughout the
table as new records are added. What I'm trying to do is create an append
query that adds 28 records to the table; in column 1 [DS3 Timeslot] I'd like
to number the records 1 through 28, in column 2 [Circuit ID] I'd like to
populate all 28 records with the same text string taken from an input box
(not sure if that's the best way or not), and finally in the 3rd column
[Entrance ID] I'd like to do the same thing but with a different text string
from a second input box.

I'm not sure if this is asking too much or how hard or easy it is. Is there
someone that can let me know if I'm dreaming or not?

Thanks,

Kevin
 
One way is to create a table tbl28 with one number field TheNumber, and
enter 28 records.

Then build an append query whose SQL view is something like this:
INSERT INTO MyTable (DS3_Timeslot, Circuit_ID, Entrance_ID)
SELECT TheNumber,
[Please enter Circuit ID value] AS Circuit_ID,
[Please enter Entrance ID value] AS EntranceID
FROM tbl28;

If you have the two strings in textboxes on a form, you can replace the
parameter expressions (e.g. [Please enter Circuit ID value]) with
references to the textboxes using this syntax:
[Forms!MyFormName!Textboxname]

In general life is simpler if you don't use spaces or special characters
in the names of fields, tables, etc. At a minimum it saves having to
remember all the [square brackets].

I have a table with 3 fields in each record that are repeated throughout the
table as new records are added. What I'm trying to do is create an append
query that adds 28 records to the table; in column 1 [DS3 Timeslot] I'd like
to number the records 1 through 28, in column 2 [Circuit ID] I'd like to
populate all 28 records with the same text string taken from an input box
(not sure if that's the best way or not), and finally in the 3rd column
[Entrance ID] I'd like to do the same thing but with a different text string
from a second input box.

I'm not sure if this is asking too much or how hard or easy it is. Is there
someone that can let me know if I'm dreaming or not?

Thanks,

Kevin
 
John --

This works perfect!! Thanks for the quick response!!

Kevin

John Nurick said:
One way is to create a table tbl28 with one number field TheNumber, and
enter 28 records.

Then build an append query whose SQL view is something like this:
INSERT INTO MyTable (DS3_Timeslot, Circuit_ID, Entrance_ID)
SELECT TheNumber,
[Please enter Circuit ID value] AS Circuit_ID,
[Please enter Entrance ID value] AS EntranceID
FROM tbl28;

If you have the two strings in textboxes on a form, you can replace the
parameter expressions (e.g. [Please enter Circuit ID value]) with
references to the textboxes using this syntax:
[Forms!MyFormName!Textboxname]

In general life is simpler if you don't use spaces or special characters
in the names of fields, tables, etc. At a minimum it saves having to
remember all the [square brackets].

I have a table with 3 fields in each record that are repeated throughout the
table as new records are added. What I'm trying to do is create an append
query that adds 28 records to the table; in column 1 [DS3 Timeslot] I'd like
to number the records 1 through 28, in column 2 [Circuit ID] I'd like to
populate all 28 records with the same text string taken from an input box
(not sure if that's the best way or not), and finally in the 3rd column
[Entrance ID] I'd like to do the same thing but with a different text string
from a second input box.

I'm not sure if this is asking too much or how hard or easy it is. Is there
someone that can let me know if I'm dreaming or not?

Thanks,

Kevin
 
Back
Top