Sei sulla pagina 1di 8

MS Access: Forms Workshop

The Population Research Institute November 19, 2002

Amy Anderson
aanderso@pop.psu.edu

Mona Lee Ostrowski


monao@pop.psu.edu

MS Access: Forms Workshop


The Population Research Institute November 19, 2002

To display a startup form when an Access project or database is opened Select Tools then click Startup In the window there is a display Form/Page box, clicking the drop down will display the forms and tables you can choose to have open upon the start of the project. Select the form you want and click OK You must exit the project first to have the form appear upon entering the project.

Tab order Alter the tab order of the objects on the form by selecting View then click Tab Order... from the menu bar.

Click the gray box before the row you would like to change in the tab order, drag it to a new location, and release the mouse button.

Command Buttons Command buttons performs tasks/procedures regarding the form and the data table. For example command buttons can search/find a record id number/key or navigate your data table via the form or print a form/report etc. In this example, a command button on the form is used to open another form.

Open the form in Design View and have the Control Wizard button on the toolbox pressed in.

Click the command button icon on the toolbox and draw the button on the form. The Command Button Wizard will then appear.

In the first dialog window, action categories are displayed in the left list while the right list displays the actions in each category. Select an action for the command button and click Next >.

The next few pages of options will vary based on the action you selected. Continue selecting options for the command button.

Choose the appearance of the button by entering caption text or selecting a picture. Check the Show All Pictures box to view the full list of available images. Click Next >.

Enter a name for the command button and click Finish to create the button.

Properties View Editing: All the field characteristics located in the form (fonts, tab indexing, masks, validations, and other characteristics) can also be created and altered in the Properties view window. The Properties view window can be brought up by clicking View in the menu bar and then clicking Properties or clicking the Properties icon in the tool bar. Each field in the form has certain properties and characteristics, which can be seen in the Properties view window. Clicking on a line in the properties window allows you to change the setting by directly making the change to the line indirectly by selecting operational expressions adding programming code called an Event Procedure, in MS Visual Basic.

Examples of direct field property changes would be altering the Font or Font Size or location using Top or Left to position a field on the form to a specific coordinate. Indirect field property changes would involve masking of date/text fields or validations of numeric entries.

Event Procedures are used to specify functions of clicking a button, entering a field of data, or opening a form based on opening the project. To create a visual basic sub program to clear a series of field entries with a click of a button: Go to the Click line in the All tab of the Properties view window Clicking on the line will display 2 buttons: o one has a down triangle o the other has ... Clicking on the down button will drop the list showing the Event Procedure option Clicking on the ... button will show a window with a choice of selecting an operational Expression, a Macro Builder or a Code Builder (building an Event Procedure)

Sample of MS Visual Basic for clearing the data from form fields from question 2:

Private Sub clearq2all_Click() Me! [q2a] = Null Me! [q2b] = Null Me! [q2c] = Null Me! [q2d] = Null End Sub

MS Access: Forms Workshop


The Population Research Institute November 19, 2002
MS Access Resources:

PENN STATEs Web Based Training Classes: Free to all at PSU with a computer id. https://wbt.psu.edu/index.asp

Online Tutorial Sites for MS Access:

http://www.fgcu.edu/support/office2000/ http://www.functionx.com/access/ http://www.bcschools.net/staff/AccessHelp.htm#AccessIntro http://cisnet.baruch.cuny.edu/holowczak/classes/2200/access/ http://www.tutorialbox.com/tutors/off2000/access/

Contains PDFs of the MS ACCESS instructions: http://mis.bus.sfu.ca/tutorials/MSAccess/tutorials.html

Online Tutorials for MS Visual Basic with Access: http://www.dcs.napier.ac.uk/hci/VB50/HTML/tutorial_12.html

http://www.vbatutor.com/vbatutor.htm

Potrebbero piacerti anche