NULL value Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mclueless
    New Member
    • Jan 2008
    • 56

    NULL value Problem

    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???
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You need to do that in validation of controls and frame the sql query dynamically .

    Comment

    • lotus18
      Contributor
      • Nov 2007
      • 865

      #3
      Originally posted by mclueless
      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

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by lotus18
        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 .

        Comment

        • lotus18
          Contributor
          • Nov 2007
          • 865

          #5
          Originally posted by debasisdas
          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

          Comment

          • werks
            New Member
            • Dec 2007
            • 218

            #6
            Originally posted by mclueless
            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="nul l" or just leave it blank..


            Better Than Yesterday

            Comment

            • lotus18
              Contributor
              • Nov 2007
              • 865

              #7
              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.

              Comment

              • lotus18
                Contributor
                • Nov 2007
                • 865

                #8
                Originally posted by werks
                Hi there,

                You could try to set the default value manually If Text1.Text="" Then Text1.Text="nul l" 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.

                Comment

                Working...