Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Tech Tips & Tricks
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop drivers dvd email error excel excel 2003 firefox hard drive hardware hdmi hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem processor recovery router safe mode screen slow sound spyware tdlwsp.dll trojan video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > General Technology > Tech Tips & Tricks >
{Moved to Tips & Tricks} Quick tip for some one new to VBA!

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
Talismanic's Avatar
Senior Member with 412 posts.
 
Join Date: May 2000
Location: Three Rivers, MI
11-Jul-2000, 11:32 AM #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
Administrator with 11,758 posts.
 
Join Date: Feb 1999
Location: Columbia, MD
Experience: Microsoft Word MVP
12-Jul-2000, 12:07 AM #2
Cool, Tal. Gotta move it to Tips and Tricks, tho!
Closed Thread Bookmark and Share

Smart Search

Find your solution!



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


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 08:21 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.