How to add Purchase Order Numbers to form?

W

walkbet

It is better not to use an Autonumber field to generate any numbers
that matter to you. Purchase Orders are one example of that. You have
no control over Autonumbers and the day might come when you'd want to
manipulate them ie: delete one and reuse it or some such manoever.
Autonumbers will make your life miserable in any case like that.

It is better to use your own numbering control through some simple code
to build what you need. Then, if you have to "go under the hood" to
control something in the future, you can.
 
A

Amy Blankenship

In the Table "tab", select the table the form is referring to. Click the
"Design" button. Add a field, make it autonumber, save the change.

Open the Form in design view. Click the "field list" button on the tool
bar. Drag your new field onto the form if you want it visible to the user.
Usually, you don't want users to have access to an autonumber field, since
it should only be used to create relationships between tables, so you may
choose not to do this step, depending on what else is going on, or to hide
it if you need to use it to establish a relationship to a subform. Having
the autonumber field in the table will be enough for the autonumber to
increment in the table itself, whether the form contains the field or not.

HTH;

Amy
 
W

walkbet

I don't have a database I could send to you, but I can give you and
idea of what is involved and you can give it a try. Here are some
some basic steps you could follow:

1] Number your existing purchase orders by creating an autonumber field
in the table. Let's assume that you'll call that field "PONumber".
2] Once all records have a number in this field, go to the design view
of the table and change the field type from autonumber to numeric.
3] Place a control for PONumber on your data entry form. Make it read
only, so that the users cannot change it. (Make the enabled property
"no" and the locked property "yes" and the tab stop property "no".)
4] Set the default value of that field to:
=dmax("[PONumber]","TableName")

Look up the dmax function in Access's help to read more about what it
does and different ways you can use it. Access has dozens of wonderful
functions to help you. It's good to know how to look them up and
understand their syntax.

Let us know how it goes!
 

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