Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old October 1st, 2003, 04:15 PM
Snowsride Snowsride is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 79 Snowsride User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 53 sec
Reputation Power: 5
Skip nulls in Paramarray

I am using the Excel Min function in Access with Paramarray to capture the parameters. It works OK if all of the parameters have non-null values but errors if any of them are null. How can I skip nulls?

I thought to concatenate any non-nulls in a string and pass that as the paramater but it doesn't work.

Any ideas?

Thanks

Mike Collard

Reply With Quote
  #2  
Old October 1st, 2003, 04:24 PM
juno juno is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 14 juno User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
have you tryed

if YourVal = ""

Reply With Quote
  #3  
Old October 1st, 2003, 07:06 PM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
To filter information instead of using a parameter, us a custom dialog box.

What kind of information is it? (dates, text, numbers)


You should set up a query and link it to the custom dialog box. Lets say you are filtering dates in the query just enter "Is Not Null" in the "date" field. This will not display empty fields. If you want to display emply fields use "Is Null" (remove the " " )

In the help section of Access type parameter and you will find information on both parameters and customer dialog boxes.

What are you using the "Min" for? (just curious)

Regards,
__________________
Regards,


John A


Reply With Quote
  #4  
Old October 2nd, 2003, 02:29 AM
Snowsride Snowsride is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 79 Snowsride User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 53 sec
Reputation Power: 5
Skip nulls in Paramarray

The values on which the Minimum function is used are contained in unbound text boxes on a form. Without going into too much detail the user may enter a value in any or all of three text boxes. I then need a procedure to calculate the minimum value of any non-null entries in those boxes. The resultant value is then used in a further calculation.

I still think the Excel Min function is the way to go and I just need some way to exclude any non-null textbox entries in the parameter e.g. I use the Min function thus Min(P1, P2, P3) to return the minimum value of P1, P2 or P3 and it works if all three contain values. But if any of the boxes has a null entry then an error occurs. Somehow I need to recreate the function each time it is called so that only non-null references are included e.g. if P2 is null then the function would be Min(P1, P3).

Have tried substituting the textbox references with a string variable that is the concatenation of any non-null references but it returns 0 (zero).

Hope the above is clear.

Mike Collard

Reply With Quote
  #5  
Old October 2nd, 2003, 03:55 AM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
Have you tried linking the form to a query (instead of table) and put Is Not Null in the Criteria for the field.


If Iam on the wrong track, post a sample db


Regards,

Reply With Quote
  #6  
Old October 2nd, 2003, 07:22 AM
Snowsride Snowsride is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 79 Snowsride User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 53 sec
Reputation Power: 5
Skip nulls

Sorted!

I used the Nz function with the valueifnull set to a ridiculously high value.

Thanks for your interest.

Mike

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Skip nulls in Paramarray


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway