Table Default Value

Knildon

Learning by Default
Local time
Today, 14:54
Joined
Jan 19, 2012
Messages
89
Hello again,:)
Having another simple but frustrating problem and I can't come up with an answer.
I have a table that has (along with others) 2 fields, "Response Sent" and "Response Received". When I print a report these 2 fields are often blank so I decided to default them to "No" so it would remind folks that a response is needed.
Problem - The table did not fully populate with the word "No". It only did about 80% of the table in a random fashion. I can't see any reason it skipped the ones it did.
Any ideas on what I should look for or where to look?:confused:
I know this is kinda like calling a doctor and saying I don't feel good, what's wrong with me, but I was hoping someone had seen this happen before.
Thanks,
Don
 
In your table design view you should be able to have "No" as the default for both of the fields.

Then run an update query on the records to ensure any of the two field's records that have null are changed to "No"

From then on, any news records will have "No" when the record is created and this is overwirtten by any data added later.
 
PNGBill,
Thanks for the quick reply. Tried what you suggested but to no avail. I still have the same results.:eek:
I even tried using IsNull and "" for criteria but no change???
Don:confused:
 
By setting the default value at table level, you will only effect new records that are created.

If you have a number of existing records with no value you will need to use an Update Query to update those exsisting records.
 
What did you try ?

You have two tasks to do.

1. Change teh table field property and test same with a new record to ensure "No" is the default value.

2. Update any existing records that have Null

How did you get on with 1. ?

For two, create a select query that only returns the Null Value Records.
Once this is done, edit the query to be an Update Query to put "No" as the value.

How far did you get with the query/sql ?
 
PNGBill,
1. I had this step done before I posted the thread and it works. The new records come up with "No" in the fields.
2. I ran a query looking for null fields and nothing showed up except for 1 record with the word No in it. As I said, I also tried "" and got the same results.
I can't run an update on something that is not there.
I'm at a loss as to what is going on here.
Don

I found an answer to the problem. I had to use "=Null" for the criteria and "" for the or criteria. This gave me a list of the empty fields so I could update them. I have no idea why I had to use both of those for criteria.:confused:
Thanks for the help.
Don
Another satisfied customer.:D
 
Last edited:
Are you sure there are Null value records ?

Open the table in Datasheet view and sort on the fields A-Z. Null value fields should be grouped.

If you have null value fields then your query/sql must be at fault.

Post the SQL using the Hash Key symbol (above)
 
See my previous edited reply.
Thanks again,
Don
 
:) I should have read it properly..

Null and "" are different.

"" implies text data that has no chrs - My best way to describe it.
Null is Nothing. Like empty space. It isn't text or numerical.

Others may give a better explanantion but you are correct, often "" and Null both have to be checked for.

One to avoid this in code is to append "" to what is there.

MyVariable = MyVariable + ""

Then check for "" only.
 
Read this link for a further discussion of the difference between Null and a Zero Length String ("") a.k.a ZLS
 

Users who are viewing this thread

Back
Top Bottom