How to get Started Using Microsoft Access Even if You've Never Used it Before by Paul Barnett - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

CREATING A FORM

At the main database window click the forms tab and select ‘New’

 

00011.jpg00012.jpg

There are various options here. The form wizard option will create a quick, simple looking form. However it is better to become familiar with form design yourself and you will gain a better understanding if you select ‘Design View’.
We need to bind the form to a data source. Remember the table we created earlier called ‘tblCustomers’ – this is what we will use as our data source.

00013.jpgSelect the data source from the dropdown box and then click the ‘ok’ button.

 

You will see a blank form has been created and also a list of fields from the table ‘tblCustomer’ is shown.

 

00014.jpgIf you don’t see the fields you can select them from the menu bar by selecting ‘View’ and then ‘Field List’.

 

00015.jpgNow we are going to add a field to the form.

 

To do this click on a field and while holding the mouse down on it, drag it to the form. Release the mouse button and you will see your field on the form.

 

00016.jpgIf you want to add all the fields at once to the form simply double title at the top of the field list.

 

00017.jpgThe field list will then become highlighted.

While these fields are highlighted hold your mouse down on any field and drag it over to the form. Release the mouse button and you will see all the fields on the form.

00018.jpg

Run this form to check out how it looks. To do this go to the ‘View’ menu and select ‘Form View’

00019.jpgTry entering some data here

 

00020.jpg

You will notice the web address turns blue to show it is a hyperlink. The data type we selected automatically handles this. This form is not the greatest design in the world and we can work on it to make it look better. If you notice the field names have their labels as one word. For example ‘FirstName’. This is due to how we entered it in the original table data source. We can change the display of the label on the form and it won’t in any way affect the table.
Lets now go back and make some alterations to the form. From the menu at the top select the ‘View’ option and then select the option ‘Design View’.

00021.jpgWe are now back at the design view of our form.

 

Right click on the label ‘FirstName’ and select the properties option. 00022.jpgYou will now see a list of properties

 

00023.jpg

We can sort out that problem of having the first name label as one word by adding a space between the words. At the caption property click on FirstName and add a space so it looks like the following:

00024.jpgNow the caption has a space between the words

 

If you now click back on the form you will notice that the label now says ‘First Name’ as opposed to what we had before ‘FirstName’.

 

This is much clearer and can be repeated for other form fields.

 

To change the background colour of the form right click anywhere on it and select properties. Click the small button next to the back color property

 

00025.jpgSelect a color and click ok.

 

00026.jpgI have changed my form now to have a greenish background

 

00027.jpg

However, the label names are now hard to see so we should change them to a lighter color.
Move the mouse just above ‘Customer ID’ and click and hold. Now drag your mouse cursor so that you form a rectangle around the labels.

00028.jpg

Release the mouse button and the fields will have small selector icons around them

00029.jpg

Now just move your mouse over the labels (do not press any mouse buttons at this stage). You will see your mouse pointer turns into a hand when you hover over the labels. At this point you should right click and bring up the properties window.

Click the button next to the fore color property so that it brings up the color selector box again.

 

00030.jpgHere I am selecting the white color for my label text

 

00031.jpg

Click ok and all the text in the labels you selected will have now turned white. We have now changed the background color of the form as well as the color of label text. You can of course change the color of individual labels by clicking on each one and selecting properties and then fore color.

00032.jpgClose the form by clicking the X

 

00033.jpgI am calling it frmCustomers. Notice the prefix for forms ‘frm’. 00034.jpgClick ok and you will now have a single form and a table in your database.