• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 22. Understanding Visual Basic F... > Some Complex Visual Basic Examples

Some Complex Visual Basic Examples

A good way to learn Visual Basic techniques is to study complex code that has been developed and tested by someone else. In the LawTrack Contacts and Housing Reservations sample databases, you can find dozens of examples of complex Visual Basic code that perform various tasks. The following sections describe two of the more interesting ones in detail.

A Procedure to Randomly Load Data

You’ve probably noticed a lot of sample data in both the LawTrack Contacts and Housing Reservations databases. No, I didn’t sit at my keyboard for hours entering sample data! Instead, I built a Visual Basic procedure that accepts some parameters entered on a form. In both databases, the form to load sample data is saved as zfrmLoadData. If you open this form in Contacts.mdb from the Database window, you’ll see that you use it to enter a beginning date, a number of days (max 365), a number of companies to load (max 50), a maximum number of contacts per company (max 10), and a maximum number of events per contact (max 25). You can also select an option to delete all existing data before randomly loading new data. (The zfrmLoadData form in the Housing Reservations database offers some slightly different options.) Figure 22-15 shows this form with the values I used to load the LawTrack Contacts database.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint