Prev: How do you prevent the mouse wheel moving to the next record?
Next: How do i recover a database lost during compacting?
From: KenB on 9 Dec 2009 22:23 I have a pointer stored in TempVars!MyIndex Within DLookup(.....) or DSum(.....) references to TempVars!MyIndex work fine but IIf(tblField = TempVars!MyIndex,.....) does not work. As a work-around I tried this: Dim NewIndex as Integer NewIndex = TempVars!MyIndex IIf(tblField = NewIndex,.....) and found it works well. So just what is the difference between temporary variables and numeric table fields? ---- Ken
From: Stefan Hoffmann on 10 Dec 2009 04:30
hi Ken, On 10.12.2009 04:23, KenB wrote: > I have a pointer stored in TempVars!MyIndex > Within DLookup(.....) or DSum(.....) references to TempVars!MyIndex > work fine > but > IIf(tblField = TempVars!MyIndex,.....) does not work. > As a work-around I tried this: > Dim NewIndex as Integer > NewIndex = TempVars!MyIndex > IIf(tblField = NewIndex,.....) and found it works well. > > So just what is the difference between temporary variables and numeric table > fields? ---- Ken TempVars are stored and retrieved as Variant. So I assume this is the cause of your problem here. Use a cast like this: IIf(tblField = CInt(TempVars!MyIndex),.....) mfG --> stefan <-- |