-
March 26th, 2014, 10:43 AM
#1
[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?
-
March 26th, 2014, 01:53 PM
#2
Re: how to get ride of Null?
Simple IF/Then statement around it, or an error trap that returns a default value.
-
March 26th, 2014, 05:18 PM
#3
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
Always use [code][/code] tags when posting code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|