Link to home
Start Free TrialLog in
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
Avatar of trbaze
trbaze

What version of access are you using?
Avatar of als315
You didn't mentioned Access version. In Access 2010 you have ribbon command:
User generated imagesource:
http://blogs.office.com/b/microsoft-access/archive/2009/07/28/meet-the-access-2010-macro-designer.aspx
SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gigifarrow

ASKER

How do you convert a macro to visual basic in 2007?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Like I said in my earlier post in Access 2007 Convert Macro to VBA... is on the Database Tools tab.
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.