Insert a default record for all values

A

Anthony

I have a table with station names for ex. SS-MICU, SS-MIMCU, ect. I need to
have a query fun and input a value of SS-MICU 00000 for all records that have
a station name. I hope this makes sense. My example is the data I pull
looks like

SS-MICU 04544 since that is the lowest number I'm pulling back and I have to
have a value of SS-MICU 00000 as the first record and I need a way to put
that in all records I have.

Thanks in advance.
 
J

Jeff Boyce

Anthony

It is rarely necessary or a good idea to insert "dummy" records.

If you'll describe in a bit more detail what you hope to accomplish (i.e.,
what business need are you "solving") by having the dummy/default record
inserted, folks here may be able to offer more detailed suggestions.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
A

Anthony

Well I'm using a program called docfinity running a form and I have to query
information in the background for station, item, and par level information.
So docfinity could only pull back this information and place it in a
dropdown. There are five dropdown boxes and by default it places the lowest
number in the dropdown. But, we need the dropbown box by default to show a
record that is a 00000 number so once the user submits the form since nothing
in my database the program is looking for the record will stay blank on the
form. The docfinity staff says that is the only way they can make it work,
so this is why I need it to place one record with 00000 with every change in
my device table. IE: I have 93 devices, so I would have to have 93 records
that have 00000. I hope this helps explain why, it is really hard to
describe if you don't see it.
 
J

John Spencer

Assuming that you have a table the lists the station Names and want to insert
this value into another table one time you could do this with a query.

INSERT Into SomeTable(SomeField)
SELECT StationNames & "00000"
FROM TableOfStationNames LEFT JOIN SomeTable
ON StationNames & "00000" =SomeTable.SomeField
WHERE SomeTable.SomeField is Null

With only 93 station names, I would assume you could simply add up to 93
records manually just as easily.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

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