Autofill in Access

G

Guest

Hi
I read a previous post on how to autofill a number in Access by using an
update query. But that seems to match the number in the other field. What I
am trying to do is to enter the same figure many times into many records.
Example:

Code Number
1 2256
2 2256
3 2256
4 2256
5 2256
6 2256

It is to match invoice numbers with record numbers. The code is the Primary
Key. I can do this by using Ctrl and the apostrophe but I am hoping there is
another way by using a Query that can populate the field to the number I
require.

Many thanks

Ann, Dublin Ireland
 
G

Guest

Hi Annie,

Try something like this. Create a new query. Dismiss the Add Tables dialog
without adding any tables. In query design view, click on View > SQL View.
You should see the word SELECT highlighted. Copy the following SQL statement
(Ctrl C) and paste it into the SQL view (Ctrl V), replacing the SELECT
keyword:


UPDATE TableName
SET [Number] = [Enter Invoice Number]
WHERE Code BETWEEN [Enter Starting Code] AND [Enter Ending Code]

where TableName represents the name of your table. Make the appropriate
substitutions. You can then switch back to the more familiar design view, if
you wish, by clicking on View > Design View. Run the query.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 

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