Temporary Variables

K

KenB

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
 
S

Stefan Hoffmann

hi Ken,

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 <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top