ciao ragazzi, allora sto lavorando con le maschere access,
Ora il mio problema è che nn riesco a costruire una if se il risultato della select è vuoto.
vi posto il codice
codice:
strSQL = "SELECT * FROM gestione_merce WHERE id = " & id & " order by ID1 Desc"
Set rstFieldData = New ADODB.Recordset
With rstFieldData
CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open Source:=strSQL, _
ActiveConnection:=cnnConnect, _
Options:=adCmdText
End With
Dim val1 As Integer
Dim val2 As Integer
Dim val3 As Integer
If IsNull(rstFieldData(8)) = True Then
val1 = Me.numero_confezioni.Value
val2 = Me.unita_per_confezioni.Value
If val1 <> 0 Then
Me.totale_carico.Value = val1 * val2 + val3
Else
Me.totale_carico.Value = val2 + val3
End If
Else
val3 = rstFieldData(8)
If val1 <> 0 Then
Me.totale_carico.Value = val1 * val2 + val3
Else
Me.totale_carico.Value = val2 + val3
End If
End If
End Sub
Praticamente quando aggiungo per la prima volta un record mi dice
errore di run-time'3021'
il record corrente corrisponde all'inizio o alla fine del file, per eseguire l'operazione è necessario disporre di un record corrente