Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query not working with Null or empty strings 1

Status
Not open for further replies.

Jedi420

Programmer
Jun 21, 2002
184
US
Hello,

Im running an UPDATE query and an INSERT INTO query where I'm experiencing this problem. When I run either query, if ANY of the values that are being updated or inserted are NULL or an empty string (""), they do not work. I recieve no message or error. I just check the data and when theres a null or empty string, the table was not updated for the UPDATE and the table for the INSERT has no new records. Is this an actual stipulation of these queries (if so, I don't know how I've gone this long without ever noticing! But, it's possible) or does something else seem to be going on here. Any ideas or suggestions would be greatly appreciated. Thnx! (^_^)


-Jedi420

A man who has risked his life knows that careers are worthless, and a man who will not risk his career has a worthless life.
 
1. DoCmd.SetWarnings True - so that you can see the error message you should be seeing when something like this happens. There are instances where you want to ignore the error message, but this is not one of them.


2. In your table design, there are some validation options you can change: "Allow Zero Length" default set to Yes. Switch this to No. Also, if it is part of the primary key for the table, you can't store a Null value either. I think the "Allow Zero Length" is what you're looking for.
 
Hey, thanks for answerin' ... I think you hit the nail on the head. A star for you, my friend. (^_^)

-Jedi420

A man who has risked his life knows that careers are worthless, and a man who will not risk his career has a worthless life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top