To the members of the Forum, Good Morning!
I have just recently started working with Microsoft Access, and I want to automate certain things to avoid mistakes.
I am using Microsoft Access 2002, and I have the following table (tblPermits) that I want to use VBA with. The first field on the table is “PermitsNr” and the second field is “Project”. Both of these fields are text fields. The “PermitsNr” is the key field.
The field named “PermitsNr” I want to contain the fiscal year (July 1st thru Jun30th) and a 3-digit number. I want to have a control button on a form that will insure that the fiscal year part of the number remains current and the other part of the number increments when a new record is started.
I envision the following:
I open the form to begin a new record, I click on the control button, the next Permit Number appears in the “PermitNr” field and the cursor moves to the next field, which is named “Project,” and I begin to enter data for the new record.
I have found a VBA script on the Website http://www.databasedev.co.uk/automatically_increment_value.html
That purports to solve this problem, but of course they are using a different table arrangement and I neither understand the code expressions or where to insert the code to run the script. I am self-taught at this point in time and I know how to right-click on a control button, choose “Properties”, and select one of the properties and use the ellipse to start the code window.
So far I have been able to use this type of approach to call up a Word template and after filling it out, call up my E-Mail to attach the document and send it.
However, that is a long way from understanding how to implement code that I find on the Internet.
The Permit Number doesn’t have to be text, I am open to suggestion on that, but it has to be a unique number or text.
One final thing. If I find something, or someone suggests something, that works for me, will the change cause a problem with what has already been entered in the database?
Thanks for your help
Sonnyboy
I have just recently started working with Microsoft Access, and I want to automate certain things to avoid mistakes.
I am using Microsoft Access 2002, and I have the following table (tblPermits) that I want to use VBA with. The first field on the table is “PermitsNr” and the second field is “Project”. Both of these fields are text fields. The “PermitsNr” is the key field.
The field named “PermitsNr” I want to contain the fiscal year (July 1st thru Jun30th) and a 3-digit number. I want to have a control button on a form that will insure that the fiscal year part of the number remains current and the other part of the number increments when a new record is started.
I envision the following:
I open the form to begin a new record, I click on the control button, the next Permit Number appears in the “PermitNr” field and the cursor moves to the next field, which is named “Project,” and I begin to enter data for the new record.
I have found a VBA script on the Website http://www.databasedev.co.uk/automatically_increment_value.html
That purports to solve this problem, but of course they are using a different table arrangement and I neither understand the code expressions or where to insert the code to run the script. I am self-taught at this point in time and I know how to right-click on a control button, choose “Properties”, and select one of the properties and use the ellipse to start the code window.
So far I have been able to use this type of approach to call up a Word template and after filling it out, call up my E-Mail to attach the document and send it.
However, that is a long way from understanding how to implement code that I find on the Internet.
The Permit Number doesn’t have to be text, I am open to suggestion on that, but it has to be a unique number or text.
One final thing. If I find something, or someone suggests something, that works for me, will the change cause a problem with what has already been entered in the database?
Thanks for your help
Sonnyboy