Unanswered: conditional macro does not work w/ SQL BE
Hi - I have an Access 2002 FE and converted my tables over to SQL server with the upsizing wizard. I had no errors during the conversion. However, I have a macro expression that worked with the back end in Access but now will not evaluate to true when I know it should. I converted the macro into VB using the wizard but of course that does not change things. I am sending the VB code in hopes that someone can tell me what I need to change to get it to work with the SQL tables.
On Error GoTo CHECK_FOR_3_MONTH_WARRANTY1_Err
If (Eval("(DLookUp(""[SERIALSHP]"",""[SS ORDER DETAILS]"",""[SERIALSHP]=[FORMS]![SR ORDER FORM]![SR FORM (SUB)].[FORM].[SERIALREC] And [SHPDT] Between Now()-1 And Now()-90""))")) Then
MsgBox "it is triggering", vbOKOnly, ""
DoCmd.PrintOut acPrintAll, 1, 1, acHigh, 1, True
DoCmd.Close acReport, "3 MONTH WARRANTY"
Forms![SR ORDER FORM]![SR FORM (SUB)].Form!WARRANTY = "WARRANTY"
You will notice that the IIf statement has the DLookup function as that is what I used originally in the macro.
Any suggestions for changing the code would be appreciated as I do not know how to write code. I have tried to figure it out from books but I do not know how the SQL has impacted the operation of this macro.
I kept getting compile errors. Is there any way that you could put the whole code on there with the changes so I can better understand where the quotes should be? I am sure I have other conditional macros that are not working and I will be able to apply what I learn from your example.
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.