Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 13th, 2004, 07:37 AM
magick magick is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 7 magick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Where's the Null?

Hi, folks. This is my first post in the forum. By way of introduction, I'm a clerk in a large bank who started creating Access databases about one and a half years ago as a solution to some of our tracking problems and paperwork overflow.

At the moment, I'm attempting to add a feature to one of my existing databases that will make certain numerical fields required depending on the content of certain other numerical fields. I was using VB to no effect so I backtracked some and tried manually changing the validation rule property on those controls in my form - to see if I could force a violation.

The default value of both the fields and controls are set to Null. My validation rule has been set to Is Not Null.

If I don't change the value of that cell, it would seem to me that I ought to get a validation rule violation, but it accepts the record just fine. I think this might be my real problem. For some reason, it isn't evaluating these fields as Null, even though I've made this my default.

Can anybody shed some light on this, or maybe offer me a work around?

Thanks in advance,
tera

Reply With Quote
  #2  
Old August 13th, 2004, 05:13 PM
ineuw ineuw is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 82 ineuw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 28 sec
Reputation Power: 5
Make sure the Required property is set to Yes. Also, you may try > 0 as the validation.

Reply With Quote
  #3  
Old August 14th, 2004, 11:05 AM
magick magick is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 7 magick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy thank you. unfortunately...

I'd rather not make my sub modify the actual table. I was hoping to work entirely with the controls in the form and keep my data source unchanged. I don't know about subsequent versions of Access, but 2002 doesn't have a 'required' control property that I can find, or I'd use that instead of validation.

Also, I did think to use >0 as an alternative to Is Not Null, but it still accepts the blank fields.

Also, I discovered something new yesterday afternoon. If I put the validation rule in the table, Is Not Null works! According to the Help file, the validation rules from both the form's control property and the table's field property are supposed to be evaluated, not one or the other. Obviously my syntax is correct (as demonstrated by what happens when I use it in the table). The only thing that I can think of is that the control Validation Rule property is buggy.

Reply With Quote
  #4  
Old August 16th, 2004, 09:28 AM
magick magick is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 7 magick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking more than one way to skin a cat

Hi, all. Just thought for the sake of closure I'd put up the work-around that I finally came to in my problem.

The lovely thing about Access is that there are two or three different paths you can take to any objective. In this case, I abandoned changing the properties of my controls and created a macro containing conditional actions of MsgBox and CancelEvent for each of the fields I wanted to evaluate. Works like a charm.

Reply With Quote
  #5  
Old August 16th, 2004, 12:13 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Thanks for posting a followup.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #6  
Old August 16th, 2004, 03:35 PM
magick magick is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 7 magick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by dhouston
Thanks for posting a followup.

You're welcome.

Being new to the group, I wasn't sure about ettiquete, but I know the first thing I do when I'm having trouble is check thread archives and I wanted to make sure anyone who found this would see the solution I came to.

tera

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Where's the Null?


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
Stay green...Green IT