UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Dynamic Query - Type Mismatch, Office 2000    
 
   
MtnGoat
post Feb 23 2012, 10:54 AM
Post #1

UtterAccess Veteran
Posts: 342



Hi. I'm using the dynamic query code from MS query samples and am getting a "type mismatch" error. Here's the part of the code that I think is causing the problem -

CODE
where = Null
      where = where & " AND [Q1_2011]= " + Me![Frame0]
      where = where & " AND [Q2_2011]= " + Me![Frame21]
      where = where & " AND [Q3_2011]= " + Me![Frame42]
      where = where & " AND [Q4_2011]= " + Me![Frame63]


Q1, Q2, Q3, Q4 are long integers and the Frames are option groups with checkbox values 1, 2, 3 . . .

Leaving all checkboxes blank returns all records as expected, but an error is generated if any box is checked.

What am I missing?

Thanks.
Go to the top of the page
 
+
 
Start new topic
Replies
John Vinson
post Feb 23 2012, 03:01 PM
Post #2

UtterAccess VIP
Posts: 2,541
From: Parma, Idaho, US



How are you Dim'ing the variable Where? If it's Text, you won't be allowed to set it to NULL - only Variants can be NULL.

You'll probably need to set a breakpoint and step through the code to figure out what's generating the error message.
Go to the top of the page
 
+

Posts in this topic


Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 23rd May 2013 - 08:17 AM