Hi Tom,
Sorry, I did not notice your reply from 8/21 until just a few minutes ago...
I was told this was not possible.
It is not possible to convert a .accdb file with embedded macros to an
earlier version .mdb file, by using the convert wizard. It is, however,
possible to convert embedded macros to the equivalent VBA code. The process
may not seem so straight-forward, and you may need to fill in some gaps along
the way, but I think it can be done. Lets give it a try.
Open the Northwind 2007 template. Open the Customer List form in design
view. Display the Property Sheet, and select the ID field. You should see the
following, on the Event tab:
On Click [Embedded Macro] V ...
Click on the Build button (the button with the three dots). You should now
see the Embedded Macro in all it's glory. Click on the Save As button in the
ribbon. Click "OK" to the prompt to Save 'Customer List' to a macro with the
same name. Close the Macro Builder, and close the Customer List form. Select
your new Customer List macro without opening it (it will error if you attempt
to run it). After selecting the Customer List macro, click on the Database
Tools tab on the ribbon. In the first group, Macro, you should see "Convert
Macros to Visual Basic". Click on this option. You should see a Conversion
Finished message. In my case, I now see the Visual Basic Editor, with a grey
background.
Click on View | Project Explorer from within the Visual Basic Editor (VBE).
In the Modules section, you should see "Converted Macro - Customer List".
Double-click on this module. You should see some code that includes "With
CodeContextObject", etc. I don't think you need to worry about incorporating
that line of code into your final conversion. It looks like it should be
something like this, once converted:
Option Compare Database
Option Explicit
Private Sub ID_Click()
On Error GoTo ProcError
If Me.Dirty = True Then 'Save the record
Me.Dirty = False
End If
DoCmd.OpenForm "Customer Details", _
WhereCondition:="[ID] = " & Nz([ID], 0), _
WindowMode:=acDialog
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure ID_Click..."
Resume ExitProc
End Sub
To be honest, I'm really not too sure about the rest of the converted VBA
code, which includes the TempVars stuff, with tests for If Not IsNull(.ID)
and If IsNull(.ID). Seems to me like saving the record would fail if the ID
was null. And, in this particular case, the ID field in the form is bound to
the ID field (Autonumber) in the Customers table.
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________