Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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.
Reply With Quote
  #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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:46 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.