There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Tag Cloud
access acer asus batch bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop lcd malware memory modem monitor motherboard network printer problem ram registry router slow software sound toshiba trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > General Technology > Tech Tips & Tricks >
{Moved to Tips & Tricks} Quick tip for some one new to VBA!

Reply  
Thread Tools
Talismanic's Avatar
Member with 412 posts.
 
Join Date: May 2000
Location: Three Rivers, MI
11-Jul-2000, 12:32 PM #1
Post {Moved to Tips & Tricks} Quick tip for some one new to VBA!
If you work with a lot of macros and are trying to learn VBA for Access. Goto Tools - Macro - Convert Macro to VBA. It is fully automatic, once it is done you can look at the module that is created to help you get to know VBA syntax.

For instance a dlook up macro that looks like this:

SetValue
[Forms]![TimeEntry]![JobName]
DLookUp("[jobname]","jobnumbers","[jobnumber]=forms![TimeEntry]![jobnumber]")


converts to a module like this:

Function UpdateJob()
On Error GoTo UpdateJob_Err

Forms!TimeEntry!JobName = DLookup("[jobname]", "jobnumbers", "[jobnumber]=forms![TimeEntry]![jobnumber]")


UpdateJob_Exit:
Exit Function

UpdateJob_Err:
MsgBox Error$
Resume UpdateJob_Exit

End Function



------------------
Building the Ultimate site list for PC support.

[This message has been edited by Talismanic (edited 07-11-2000).]
Anne Troy's Avatar
Computer Specs
Moderator with 11,785 posts.
 
Join Date: Feb 1999
Location: Columbia, MD
Experience: Microsoft Word MVP
12-Jul-2000, 01:07 AM #2
Cool, Tal. Gotta move it to Tips and Tricks, tho!
Reply

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:09 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.