A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Insert a default record for all values



 
 
Thread Tools Display Modes
  #1  
Old March 11th, 2010, 04:01 PM posted to microsoft.public.access.queries
Anthony
external usenet poster
 
Posts: 356
Default Insert a default record for all values

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.


  #2  
Old March 11th, 2010, 04:09 PM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Insert a default record for all values

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.

"Anthony" wrote in message
...
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.




  #3  
Old March 12th, 2010, 12:51 PM posted to microsoft.public.access.queries
Anthony
external usenet poster
 
Posts: 356
Default Insert a default record for all values

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.

"Jeff Boyce" wrote:

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.

"Anthony" wrote in message
...
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.




.

  #4  
Old March 12th, 2010, 02:00 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Insert a default record for all values

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

Anthony wrote:
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.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.