Using Objects
Now that you’ve learned the basics of Visual Basic, you’re probably itching to get to work with some practical code. The following sections present two examples that put control objects to work.
Tip
If you’re eager to explore even more objects, you can find an object-by-object reference in the Visual Basic Help. To get there, choose Help→Microsoft Visual Basic Help. (If you see a message stating “This page is unavailable”, then click “Connected to Office.com” at the bottom-right corner of the Access Help window, and choose “Show content only from this computer.”) To get to the object reference, click the Access Object Model Reference link.
Indicating That a Record Has Changed
Record editing is a two-stage process. First, you change one or more field values, which places the record into Edit mode. Then, you close the form or move to another record, which commits your change. Or you press Esc, which cancels your changes, and then reverts to the original values.
If you’re using the Record Selection bar (meaning the Record Selectors property of the form is set to Yes in the Property Sheet, which is the standard setting), Access indicates when you’re in Edit mode by changing the tiny arrow in the form’s top-left corner to a tiny pencil icon. This icon is a helpful indicator that something has changed on your form and that you need to decide whether to go through with the update. However, Access newbies and pros alike can easily miss the tiny pencil icon. That’s why some people ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access