Examples with DAO and Access97

Speaker Notes

Slide 1:

This gives additional examples using DAO which is compatible with Access 97. The database file is InvenTre.mdb.

Slide 2:

This shows the connect to the database which was created in Access 97.

Slide 3:

This shows the link of the txtItemNo box to the DataField ItemNo and the DataSource

Slide 4:

The link to the database means that the information requested on the form is shown. This slide shows the first record.

Slide 5:

I am linking to the InvenTre.mdb database and specifically to the Tee table on that database (recordsource). The connection is to Access.

Slide 6:

datTree is the name I gave the Data control that links to the database and ItemNo is the field on that database that I am linking to this field.

Slide 7:

As you can see txtMarkup is not linked to any DataSource or any DataField. This is true for the % Mark Up area as well.

Slide 8:

When the txtItemNo changes, the information for the next record is calculated. Note that formatting of the text boxes containing price, cost, markup and percent markup is also done.

Code will be continue on slide 10 and 11.

Slide 9:

The markup and markup percent are calculated based on cost and price using the calculations shown in the previous slide.

Slide 10:

SelStart is a property that can set the starting point of the selected text - it can also be used to return the starting point.

SelLength is a property that returns or sets the number of characters that are selected.

From Microsoft Visual Basic Help

Slide 11:

When text price looses focus, the markup and the markup percent are recalculated. The change in price will show on the database.

Slide 12:

Note that the change in price that was made on the previous slide shows in the database.

Please note that this form is linked to the database and the text boxes are linked to the database in the same way as shown on previous slides in this presentation.

Slide 13:

On the previous slide, I started to search for Elm. This shows the successful retrieval of the tree named elm.

Slide 14:

This shows the code to add a record, delete a record, exit, move to the first record and move to the last record. More code is shown on the next slide.

Slide 15:

This shows move next and move previous with code to make sure that I do not go outside the range of the file.

This code also shows the code for doing a search to find a record that matches the name entered.