Varför invalid Use of null när den försöker sätta RS4 till Integer variabeln iMaxi? Hej Tack med en liten if sats verkar det iallafall vid första anblicken funka perfekt.. vad innebär kodraden  Jag skulle skriva: IgenInvalid use of Null
    
    
SQL = "Select MAX(Redid) As Maxi FROM REDOV"
OppnaRS4
iMaxi = RS4!Maxi
            iMaxi = iMaxi + 1
            txtRedid.Text = iMaxi
RS4.Close
MVH ANTSv: Invalid use of Null
    
    
Testa detta
iMaxi = RS4!Maxi & ""
            iMaxi = iMaxi + 1
            txtRedid.Text = iMaxi 
mvh
SvenSv: Invalid use of Null
    
    
iMaxi = RS4!Maxi & ""
Kommer det här funka när jag får fler poster i databasen?
Tack igen..
AntSv: Invalid use of Null
    
    
SQL = "Select MAX(Redid) As Maxi FROM REDOV"
RS4.Open SQL
If IsNull(RS4("Maxi")) Then
    iMaxi = 1
Else
    iMaxi = RS4("Maxi") + 1
End if
            
txtRedid.Text = iMaxi
RS4.Close
Alternativt:
SQL = "Select MAX(Redid) As Maxi FROM REDOV"
RS4.Open SQL
If IsNumeric(RS4("Maxi")) Then
    iMaxi = RS4("Maxi") + 1
Else
    iMaxi = 1
End if
            
txtRedid.Text = iMaxi
RS4.CloseSv: Invalid use of Null
    
    
>vad innebär kodraden  iMaxi = RS4!Maxi & ""
Jag lägger till en tom sträng så är det inte Null längre
Det är alltså skillnad på Null och nollsträng
mvh
Sven