Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Access 2013 Programming
This is the forum to discuss the Wrox book Professional Access 2013 Programming by Teresa Hennig, Ben Clothier, George Hepworth, Dagi (Doug) Yudovich; ISBN: 978-1-118-53083-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Access 2013 Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 10th, 2014, 12:47 PM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default query by view problem

In Chapter 8 page 241 it discusses creating a optional query parameter by adding a OR [para] IS NULL to the criteria. I created a example that works fine when I pass it a regular value. But when trying to pass it the NULL I just get a “Sorry, a server error has occurred” message.

Here is what I did to try this:
Created a query of my data with a parameter and used it in the criteria like “[pOrg] OR [pOrg] IS NULL”. When saved and then Designed View’ed again Access has created a column for the [pOrg] with criteria IS NULL and used the [pOrg] under my column as a Equals criteria. Just like the example in the book.

I created a DataSheet View based on the query.

On a form I added a TextBox for the filter value and a Button to open up the datasheet view as a popup. In the button macro I test the TextBox for a null or value and do a SetVariable called gTxtFilter to either NULL or the text box value. In a OpenPopup I selected my datasheet view and set the parameter to gTxtFilter.

What am I doing wrong?

PS: I have some screen shots of this, but see no way to post them.
  #2 (permalink)  
Old July 26th, 2014, 07:50 PM
Registered User
Points: 18, Level: 1
Points: 18, Level: 1 Points: 18, Level: 1 Points: 18, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2014
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just to be 100% sure we set the criteria correctly, enter the criteria as this way:

Code:
[yourColumnName]=[pOrg] OR [pOrg] IS NULL
When you save the query and open it, it will look a bit different because as explained in the book (pg. 244-246), Access query designer changes the expression into two columns. For multiple parameters, it could be daunting and thus, keeping the original criteria in a notepad is probably good idea when you need to edit the query.


Similar Threads
Thread Thread Starter Forum Replies Last Post
MVC View - The result of a query cannot be enumerated more than once. Ossieboy ASP.NET 4 General Discussion 0 April 11th, 2013 03:48 PM
Grid View Problem Ranveer@2468 ASP.NET 3.5 Basics 6 February 18th, 2011 02:00 PM
Grid View problem help please Shimul Mahmud ASP.NET 3.5 Professionals 0 March 8th, 2010 03:51 AM
Datasheet view of a Query - Field Format arfa Access 4 March 13th, 2006 12:34 PM
Materialized view problem cdias Oracle 0 December 10th, 2003 08:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.