Ok guys, I'm probably making a rookie mistake here with VBA, but I can't get grip on where I'm making it...:banghead:
I've got a DoCmd.runSQL in my VBA, which contains two IIf statements. To make the VBA readable for everyone who might need to work on it, I've pulled the IIf out from the DoCmd.runSQL and created a string as follows:
To check the outcome before I continue, I've built a simple MsgBox to display the strPODTarget.
For some reason, I don't get any value in the MsgBox, although in a simple query this IIf statement works like a charm.
I think I'm making a mistake in referring to the QRY_Gross_Performance_3, but I am staring blind at it.
Thanks for any help.
I've got a DoCmd.runSQL in my VBA, which contains two IIf statements. To make the VBA readable for everyone who might need to work on it, I've pulled the IIf out from the DoCmd.runSQL and created a string as follows:
Code:
Dim strPODTarget As String
strPODTarget = IIf([QRY_Gross_Performance_3]![POD Target Time] = "", [QRY_Gross_Performance_3]![POD Gross], "Check - End Loc. Country not in TBL_Source_POD_Margin")
To check the outcome before I continue, I've built a simple MsgBox to display the strPODTarget.
For some reason, I don't get any value in the MsgBox, although in a simple query this IIf statement works like a charm.
I think I'm making a mistake in referring to the QRY_Gross_Performance_3, but I am staring blind at it.
Thanks for any help.