Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Invalid Use Of Null (A2k)

    With the code:

    <pre>Dim strEst As String
    Dim strSup As String
    Dim strNotes As String

    strEst = Me.Est_No
    strSup = Me.SUP_NO
    strNotes = sbfProgress.Form.Notes


    DoCmd.RunCommand acCmdSaveRecord
    WriteNote GetComputerName & " , " & GetNetUser & " , " & strEst & " , " & strSup & " , " & Nz(strNotes, "-") & " , "
    DoCmd.Close acForm, Me.Name</pre>


    I get "Invalid use of Null" when trying to empty, or delete the contents of the field [Notes],
    On the other hand, if I enter data, the command works fine.
    Can any-one see anything obvious ?

    As you can see I tried to implement the NZ function, still it doesn't work.

  2. #2
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Invalid Use Of Null (A2k)

    Try strNotes = Nz(sbfProgress.Form.Notes,"-")

    instead of

    strNotes = sbfProgress.Form.Notes
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Invalid Use Of Null (A2k)

    Well done that man. Perfect.

Posting Permissions

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