VBA Event Driven Programming

In this video I demonstrate the Procedural/Application programming difference.

We’ll cover Access form events:

Creating An Event Procedure
Reacting To User Actions Programatically
Using the DoCmd Object
Program Flow
Frame and Option Button Events
Command Button Events
Drop Down Box Events

(Click here for the Navigating Records part.)

<< Free Access programming tutorial Video 10

VBA Form Object Event Procedures>>

Using our form from the last video, add and “image” control to the top called “imglogo”:

Click it, then draw the image on the top of your form. The click “Cancel” when the “Insert Picture” dialog appears. You can either select the image from a specific folder, or code it to appear on the load event. We are doing the latter.

Right click the image and make the Properties dialog box appear. From the “Property Sheet”, click “Other” then “Name”, and call it, “imgLogo”.

We code it for the image to appear when the form loads.

Private Sub Form_Load()
    Me.imgLogo.Picture = &quot;C:\WINDOWS\ServicePackFiles\i386\mslogo.jpg&quot;
End Sub

Private Sub fraCustomerLabels_Click()
    If Me.fraCustomerLabels.Value = 2 Then
        Me.cboCountry.Requery
        Me.cboCountry.SetFocus
    End If
    
End Sub




By the way, if you got or are getting value from the VBA information, please give me a tip, thanks!


These posts may help answer your question too...

How To Parse A Flat File In Excel VBA

In another post I demonstrated how to access a file on your computer using the MS Office Library. Here it is if you don’t know what I’m talking about. In this post, I am going to show you how to access the file and load it into your spreadsheet. I will do the same thing […]

How can I interact with other Office applications (Excel) using VBA in Access?

Need to write your Access data or query to an Excel file? Here is the how to do it: Most people are familiar with Excel and know how to use it well (enough), and when you start talking about Access, they get scared off, and don’t know what to do anymore. Well, here you are […]

How To Create A Parameter Query In Access

A parameter query changes your ordinary static access query to be more dynamic and interactive. It will ask you a question about what you want to search for, allowing you to do a search query multiple times instead of just once. You can do your parameter query straight from the QBE (Query By Example) Editor, […]

What Is Microsoft Access Used For?

To those of you who are asking the question of “What is microsoft access used for?” , here is my opinion. I’ve been using this program for well over 15 years, and it’s become fairly easy to deal with. Many people feel that it is hard to work with, but that’s not my experience anymore […]

Previous Post

VBA Form Object Event Procedures

Next Post

Database Access From Anywhere

Leave a Reply

Your email address will not be published. Required fields are marked *