A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Temporary Variables



 
 
Thread Tools Display Modes
  #1  
Old December 10th, 2009, 03:23 AM posted to microsoft.public.access.tablesdbdesign
KenB
external usenet poster
 
Posts: 24
Default Temporary Variables

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

  #2  
Old December 10th, 2009, 09:30 AM posted to microsoft.public.access.tablesdbdesign
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default Temporary Variables

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.