Avatar of gigifarrow
gigifarrow
 asked on

Transferring a Macro into Visual Basic code.

I have a macro that is used after update.


I need to transfer that into Visual basic code Because I need to add more code that is in visual basic.

This is the Macro I need Transfered into visual basic:
After_Update_MOD
Action                                          Argument
Set Value                [Forms]![frmVehicleMOD]![Part Number], DLookUp                   ("[PartNumber]","[tblMODKits]","[MOD Kit]= Forms![frmVehicleMOD]![MOD]")

Set Value                     [Forms]![frmVehicleMOD]![MWO], DLookUp("[MWO]","[tblMODKits]","[MOD Kit]= Forms![frmVehicleMOD]![MOD]")



Once the code does this I am adding the following code which is based on what the output of the Macro below displays:

If Me.MOD = "BFCS" Then
MsgBox "Please Enter Fuel Cell Information." Then

DoCmd.OpenForm "frmfuelCellInfo"

If Me.MOD = "AFES CEP Protective  Switch Guard" Then
MsgBox "Please Enter Fuel Cell Information."

DoCmd.OpenForm "frmfuelCellInfo"


End If
End If

End Sub
Microsoft Access

Avatar of undefined
Last Comment
trbaze

8/22/2022 - Mon
trbaze

What version of access are you using?
als315

You didn't mentioned Access version. In Access 2010 you have ribbon command:
convert macrossource:
http://blogs.office.com/b/microsoft-access/archive/2009/07/28/meet-the-access-2010-macro-designer.aspx
SOLUTION
Norie

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
gigifarrow

ASKER
How do you convert a macro to visual basic in 2007?
Your help has saved me hundreds of hours of internet surfing.
fblack61
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Norie

Like I said in my earlier post in Access 2007 Convert Macro to VBA... is on the Database Tools tab.
trbaze

Yes, its exactly like what imnorrie said except that you don't open the macro in design view, just highlight the macro in the navigation pane.