[RESOLVED] how to get ride of Null?
Code:
Private Sub cus()
Dim cnview As New ADODB.connection
Dim rsemployee As New ADODB.Recordset
Call connection(cnview, App.Path & "\Commissions.mdb", "endromida")
Call Recordset(rsemployee, cnview, "SELECT * FROM customer WHERE idcn ='" & txt1stID.Text & "'")
If rsemployee.RecordCount = 0 Then
MsgBox "The record you requested could not be found.", vbExclamation, "Medrar"
Exit Sub
End If
With rsemployee
txtFan.Text = .Fields!fname
txtFisNa.Text = .Fields!fsna
txtSecNa.Text = .Fields!sena
txtLasNa.Text = .Fields!trna --- Null Error
txtFulNa.Text = .Fields!funame
txtMob.Text = .Fields!mobie
txtExpDate.Text = .Fields!exd
End With
Set cnview = Nothing
Set rsemployee = Nothing
End Sub
Run time Error
Null
how to accept null values?
Re: how to get ride of Null?
Simple IF/Then statement around it, or an error trap that returns a default value.
Re: how to get ride of Null?
I already told you two ways to solve your issue in the other thread,
Why did you start a new thread on it?
Simply append an empty string like I showed you in the other thread or use an if test to test for null
Also when posting an error message it is best to post the actual error message so people can understand what you are talking about. In this case the error would be
Invalid use of Null