
Custom Buttons:
Notice the custom made buttons on the following form:

These buttons can be made and placed on any form:
The Display Current Invoice button displays a report based on a query that you have created
Custom buttons are easier to use than having the user select a report and can be used to restrict a user from only doing what you want them to do with the database
When you press this button the following mini program is run
Private Sub Command21_Click()
On Error GoTo Err_Command21_Click
Dim stDocName As String
stDocName = "rptTransactionsCompleteCurrent"
DoCmd.OpenReport stDocName, acPreview
Exit_Command21_Click:
Exit Sub
Err_Command21_Click:
MsgBox Err.Description
Resume Exit_Command21_Click
End Sub
The mini program above can be typed out in a Module
- Whatever you can dream of doing in Microsoft Access but can't accomplish using tables/forms/queries/reports etc. you can probably do with a Module
- A module allows you to write computer programming code into the program to do very complex tasks and interact with other programs
What if you don't know how to program?
Answer
Fortunately a wizard can be used to create the program in red above as it is common to make buttons to print out reports
Private Sub is used to create a program and in the example below Command21-Click is automatically given as a name to the program
Private Sub Command21_Click()
- The end of this mini program is indicated by the following line:
End Sub
- The following line of code opens the report:
stDocName = "rptTransactionsCompleteCurrent"
DoCmd.OpenReport stDocName, acPreview
The rest of the code deals with any computer errors that may happen.
You can create other mini programs in Modules that do virtually anything you want
Examples of pieces of code used in mini programs in Modules:
MsgBox ("Incorrect password, try again")
The above code will make a pop up message box appear informing the user of an incorrect password.
MsgBox ("Restricted access ")
The above code will make a pop up message box appear informing the user that access is restricted.
Note you can enter anything in the quotation marks that you want to appear on the message box.
You can create an InputBox which is similiar to a message box, however it allows the user to enter in information
InputBox("What is the password?")
You can also change the properties of fields, for example make one of the fields "locked" so that a user can view information in a form but not make changes
Me.LastName.Locked=False
The code above must be entered in the correct format (learning this programming language is very advanced).
Do you need to be a programmer to create advanced Microsoft Access databases?
No, however a little bit of knowledge of code can be used to create some very useful aspects to your database.
Computer programmers will be comfortable with this and sometimes it is useful to get a programmer to handle certain pieces of large database projects.
You can even find experienced programmers on the Internet who you can e-mail a project to and they will do some advanced work on it and e-mail it back, usually charging between $75 - $150 per hour.
In fact there are Access designers (without extensive programming knowledge) who design Databases and also charge usually a minimum of $50-$100 per hour.
Just think, if you worked on a database for 100 hours at $50 per hour the charge to the client would be $5,000...this may be a great deal to some business owners who are unable to buy software that meets their needs and need a "custom" application.
As a database designer you may be able to sell the database to other clients as well (without having to do any extra work).
Although not covered at this point you can also buy a developer's kit for Microsoft Access which converts the program into a format that doesn't even require the user to have Microsoft Access...only the forms and buttons that you create will appear for users to use.
Microsoft Access databases can be used by multiple users at once as well, meaning that for example 50 teachers could be logging on to the program over a network if the file is placed in a shared folder. Microsoft XP allows up to 10 users at once, more than 10 users can use the file if it is placed on server software.

This website is copyright protected see contact page for details.
|