Custom Form

Sonnyboy

New member
Local time
Today, 10:12
Joined
Sep 13, 2007
Messages
9
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
 
Well, where do you retrieve the fiscal year's value: is it in another field, is it based on the system date? Does it have the format 2007/2008 or 07/08 or 0708 or whatever? Pls give an example of a few contiguous values for PermitNr.

Regards,
Premy
 
Premy, I have used VBA to solve the problem. A Field called "FiscalYear" keeps track of what fiscal year it is, and everything is working fine at this point.

I appreciate your interest and will probably have questions in the future. The reason that I have not replied to your questions earlier is that your E-Mail was re-directed to my trash folder, and when I opened up the program today there was a blur indicating that something had been re-directed. Sure enough there was a lot to be looked at. I try to scan through all of the African messages that want to make me a millionaire, and once in a while, there is a bono fide message.

Once again, thanks

Sonnyboy
 

Users who are viewing this thread

Back
Top Bottom