Link to home
Start Free TrialLog in
Avatar of gsilouisvilleic
gsilouisvilleicFlag for United States of America

asked on

Macro if Statement Backward compatible

I have a Access Database that was made on Access 2016 but when i tried it on Access 2007, there was a backward compatible issue.   i have my database file attach if anyone can see how to fix it.  I know it has to do with the if statements on my macro but dont know how to fix it.  thank you
Test.accdb
Avatar of Hamed Nasr
Hamed Nasr
Flag of Oman image

I opened your uploaded file in both Access 2016 - Windows 10, and Access 2007 -  Windows Vista. Both opened main form. What is the issue, try to step me through to see the problem
Avatar of gsilouisvilleic

ASKER

its the macro.  so click on the inspection form button then on the inspection form click on save record button on the bottom left.
I think the best way to deal with this problem is to replace the embedded macros with code -- there is nothing complicated here.  To open the inspection code to a new record, no code is needed; just set its DataEntry property to Yes.  To open the inspection form from the main menu and close the menu, this code is all you need:

Private Sub B_Save_F_Inspection_Form_Click()

   DoCmd.OpenForm "F_Inspection Form"
   DoCmd.Close acForm, Me.Name
   
End Sub

Open in new window

For Macro1, on the Save button, this code could also be converted to VBA code -- it is long, but not at all complicated.
its the macro
I'll be back to it if issue not resolved.
I tried running the macro, and got this reference error, which probably is not a problem on your system:
User generated imageCan you step through the macro to determine which action causes errors?
SOLUTION
Avatar of Helen Feddema
Helen Feddema
Flag of United States of America image

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
Even though it may not cause an error here, it still is not a good idea to name table fields Date, Time, Sum, etc.
Nothing is absolute no!
But if naming is not followed properly, it restricts you of using some forms of statements.

https://support.office.com/en-US/article/guidelines-for-naming-fields-controls-and-objects-3c5d8ebd-08b5-472a-ae57-c3632910068b
Thank you both for your help.  We are going to update all system to the new Access 2016 which will not have the issue anymore.