Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting Type Mismatch RT 13? (A2k (9.0.3821) SR-1)

    Getting Type Mismatch RT 13?

    A2k (9.0.3821) SR-1

    Getti n Runtime Error 13 Type mismatch

    intNumberOfIntervals = Nz(CInt(strNumberofIntervals), 0)

    How should I code the above to eliminate this error?

    This is happening on a record where I know strNumberofIntervals is blank

    Thanks, John

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting Type Mismatch RT 13? (A2k (9.0.3821) SR-1)

    Remove the CInt.
    intNumberOfIntervals = Nz(strNumberofIntervals, 0)
    Francois

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting Type Mismatch RT 13? (A2k (9.0.3821) SR-1)

    Hi Francois

    Same error, here is more of the code:

    Dim strIntervalOfTime As String
    Dim strNumberOfIntervals As String
    Dim intNumberOfIntervals As Integer

    strIntervalOfTime = Me![lngTypeID].Column(12) ' Interval of Time to expire
    strNumberOfIntervals = Me![lngTypeID].Column(11) ' Number of Intervals to expire
    intNumberOfIntervals = Nz(strNumberOfIntervals, 0)

    Thanks, John

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting Type Mismatch RT 13? (A2k (9.0.3821) SR-1)

    Try
    intNumberOfIntervals = Val(Nz(strNumberOfIntervals, 0))
    I haven't see that one was a string and the other an integer. Sorry
    Francois

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Getting Type Mismatch RT 13? (A2k (9.0.3821) SR-1)

    Or use a CInt instead of the Val. It will give the same result and is more self-documenting.
    Charlotte

Posting Permissions

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