Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA for Access (A2k)

    I have the Beginning Access 97 VBA Programming book, but am having some difficulty finding a list of available actions or methods. There are some idices, but they seem to be incomplete. Say, for example, I want to put a command button on a form to automatically print a daily report of transactions. I know that this would require an event property of the command button, but where would I find the name of the event property. I don't know if I'm saying that correctly or not. An example would be "SetFocus". I can't find a list containing that command, or others like it. The book states that actions are part of macros, not VBA. I'm confused! <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15> Please help!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA for Access (A2k)

    Welcome to the world of technical jargon!

    In Access, the word action is used for the parts of a macro. In Visual Basic, objects have properties, methods and events. Roughly speaking (and oversimplifying things a bit), the value of a property describes a situation, a method does something (so it is similar to an action) and an event is triggered by something outside the object, for instance the user clicking the mouse, or pressing a key.

    There are several ways to learn about properties, methods and events in the Visual Basic Editor for Access itself:

    1. The Object Browser. In the Visual Basic Editor, press F2 to open the Object Browser. Type something in the search box, then press Enter (or click the binoculars). For example, type commandbutton and press Enter. You'll see several entries; click the one with CommandButton in the Class column. In the lower part of the window, you'll see a list of all available properties, methods and events. They are distinguished by different icons (the thunderbolt is an event, and the little page with a hand is a property). If you click one of these, extra information will appear in the bottom pane of the window. Press F1 to get help (if available).

    2. The online help. Although the HTML help in Access 2000 and 2002 is much harder to use than the Windows help in Access 97, and much less complete, there is still a lot of information to be found. Type something associated with Access, such as DoCmd, in a module or in the Debug window, and press F1. The online help opens. Switch to the Contents tab and expand the f

  3. #3
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA for Access (A2k)

    As I said before, I'm in a foreign country and no one speaks English!!--Thanks for the "oversimplification", that works well for me. The analogies you used are perfect. In fact, that is the easiest way for me to understand a difficult (to me) concept.

    Your help, as usual, is much appreciated, Hans <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

  4. #4
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA for Access (A2k)

    May I recommend the VBA tutorial on my site? It takes a little different approach then most 'books' on the topic. http://www.wolfwares.com

    The sites a little bare, and the tutorial which I wrote years ago has some grammar issues <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>, but it should help if you are trying to dig into VBA.

    As to your particular question, every Office application which lets you use VBA, has it's own object model. An object model is what lets you use the functions and features of that application from within VBA code. In Access, the object model gives you a DoCmd command. The best way to describe a DoCmd statement, is that it lets you do everything you get from the actions of a Macro.

    Thus, the two ways to learn about them are to lookup the DoCmd Function in the help files (97 preferably), or to make a macro that does what you want, then convert the macro to a module. It will show the code equivalent of what you can do in a macro (the old trial by example method! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>)

  5. #5
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA for Access (A2k)

    Hi Drew,

    I actually printed out the tutorial last week, and just dove into it yesterday. It's making more sense to me. The Beginning Access 97 VBA book is good, but assumes that the reader has prior knowledge of just the very basic procedures and terms. Unfortunately, it came to me without the disk with all the sample stuff on it, so I'm not able to follow along with the book in "real time". Looks like I'm gonna have to take a class <img src=/S/crybaby.gif border=0 alt=crybaby width=15 height=15>

    Any other book suggestions? "Dummies" maybe?

    Thanks for having the tutorial available, it's a great resource <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

  6. #6
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA for Access (A2k)

    Class? Ack. Sorry, can't really recommend any books, because I have never really used any books when it has come to Acces, VBA, VB, ASP, HTML, etc. There are a ton of resources, free ones, on the net. The only trick is to learn how to turn what you don't know into a question you can find on the net. More then likely someone has answered that question already.

    As far as classes go, ask around locally, to people with the skill sets you want. A lot of classes are worse then a book, because they are just as limited as to requiring background knowledge, but instead of going at your own pace, you're forced into their pace.

  7. #7
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA for Access (A2k)

    Hmmm, that's unfortunate. The only person locally who has the skills I want is our database guru, but he doesn't speak "English", just computer language. He's this absolutely brilliant guy, but can't dumb it down enough for me. The Access classes I took were good, and if I took them over again now, I'd get a lot more out of them, as I'm more familiar with everything. In fact the books that went with each class had Woody's Lounge listed as a resource, and voila, here I am. Unfortunately, they don't go far enough for what I want to do with this application. If only I could just write everything out in simple sentences that I need this thing to do, and then hit a button, all would be fine. But since I don't speak VBA, it's just not possible! Oh well, I'll just muddle along and keep <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16> !
    Thanks

  8. #8
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA for Access (A2k)

    Well that little tutorial on my site should give you the basics of VBA. The important part of programming isn't knowing all of the functions available, its understanding the concepts of actually how to create a logical solution for a computer, from an illogical problem created by a person! <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

    Once you understand how to write some of your own VBA code....and feel comfortable at that level, post problem specific questions to the lounge, and I'm sure no one will mind explaining more advanced code to you. We have all be tutored in one way or the other while at the lounge.

    By the way, two more good Access resources are http://www.mvps.org/access and http://www.databaseadvisors.com . That last one is what lead me to the lounge. It is an email based 'newsgroup'. Their main 'list' is Access (which I host their archives on my website), but they also have other lists. The Access list is a really great resource (in fact some of the people that post here in the Access section are just as active on the AccessD list.).

    Good Luck...

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VBA for Access (A2k)

    There's also the Access-L list (http://peach.ease.lsoft.com/archives/access-l.html ), which is unmoderated and tends to field somewhat less technical questions than the AccessD list (databaseadvisors.com)
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •