By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

NULL value Problem

P: 56
There are some fields on our form which when filled should be saved to the database. Now, if the user doesnt enter any value for a particular field then that should be saved as NULL by default. How should this be done???
Jan 25 '08 #1
Share this Question
Share on Google+
7 Replies


debasisdas
Expert 5K+
P: 8,127
You need to do that in validation of controls and frame the sql query dynamically .
Jan 25 '08 #2

lotus18
100+
P: 866
There are some fields on our form which when filled should be saved to the database. Now, if the user doesnt enter any value for a particular field then that should be saved as NULL by default. How should this be done???
The default is null (of course), unless you set your fields to "Yes" (Required). I assume you're working on access.

Rey Sean
Jan 25 '08 #3

debasisdas
Expert 5K+
P: 8,127
The default is null (of course), unless you set your fields to "Yes" (Required). I assume you're working on access.

Rey Sean
Who told you that the default value is NULL ?

And the user is asking for data entry from the form .

Read the questions properly before replying and no need to assume anything .
If you have any doubts just ask the user to clarify that .
Jan 25 '08 #4

lotus18
100+
P: 866
Who told you that the default value is NULL ?

And the user is asking for data entry from the form .

Read the questions properly before replying and no need to assume anything .
If you have any doubts just ask the user to clarify that .
OK sorry. I was just giving out what I understand of mclueless's post. : ). Again, I'm really sorry for giving such an inconsistent answer. : )

Rey Sean
Jan 25 '08 #5

werks
100+
P: 220
There are some fields on our form which when filled should be saved to the database. Now, if the user doesnt enter any value for a particular field then that should be saved as NULL by default. How should this be done???
Hi there,

You could try to set the default value manually If Text1.Text="" Then Text1.Text="null" or just leave it blank..


Better Than Yesterday
Jan 25 '08 #6

lotus18
100+
P: 866
Sorry for my post #3

I posted that because I was thinking for an error handler, if it is empty it can prompt a messagebox that you need to enter a value. Please forget about it. I'm really really wrong about the Default Value is null. Hope you understand.
Jan 25 '08 #7

lotus18
100+
P: 866
Hi there,

You could try to set the default value manually If Text1.Text="" Then Text1.Text="null" or just leave it blank..


Better Than Yesterday
hi werks

There's also another option for that, you can set your (database) field's properties to Default Value to "NULL". It would automatically display 'NULL". but of course this depends upon what strategy are you going to used in saving your record.
Jan 25 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.