Results 1 to 2 of 2

Thread: Adding a recordset with Access...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    19
    Hello, again. I have a problem that I have not been able to reslove, and I was hoping that someone with a knowledge of Access and DB's could give me some advise:

    I have a form that adds a record to an existing recordset (grsCustomers) in an Access database. I have written smaller projects for an SQL database, but can't get this one to work using Access. I have 17 fields in all, 14 of them which I don't want to deem as necessary...I want to allow null values, but I think this is the problem I am running into with Access. I have the field set to "Allow Nulls" in Access, but it keeps giving me errors:

    Private Sub cmdAddNew_Click()
    LoadRecord
    End Sub

    Private Sub LoadRecord()
    With grsCustomers
    !FirstName = txtFirst.Text
    !MiddleInitial = txtMI.Text
    !LastName = txtLast.Text
    !StreetNumber = txtStNum.Text
    !Direction = txtDirection.Text
    !Street = txtStreet.Text
    'etc...
    'etc...
    End With
    End Sub

    I keep getting errors associated with trying to add null fields to the database. I have the property "Accept Null Values" (it is titled something like that in the design view of Access) to True or Yes, but I keep getting the error. Any suggestions? This is not an issue with an MS SQL database...is there a certain format for putting in a null value into Access?

    could I get a coding example similar to what I have given as a guide?

    Thanks so much!

    FLL








  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    I believe its the "AllowZeroLength" property of these fields that's causing the trouble. Make sure that property for these fields is set to "Yes" (it is "No" by default).
    "It's cold gin time again ..."

    Check out my website here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width