Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null values in field of recordset
Message
From
17/10/2001 16:44:53
 
 
To
All
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Null values in field of recordset
Miscellaneous
Thread ID:
00569912
Message ID:
00569912
Views:
46
Dim cnSMDR1 As Connection
Dim rsCodes As Recordset
Private Sub Form_Load()
Dim NewItem As ListItem
Set cnSMDR1 = New Connection
cnSMDR1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= C:\Tracit\SMDR1.mdb"
Set rsCodes = New ADODB.Recordset
rsCodes.CursorLocation = adUseClient
rsCodes.Open "Codes", cnSMDR1, adOpenStatic, adLockOptimistic

listNxx.ListItems.Clear
txtNpa = ""
End Sub
Private Sub Search_Click()
rsCodes.Filter = "NPA =" & (txtNpa.Text)
Do While Not rsCodes.EOF
Set NewItem = listNxx.ListItems.Add(, "A" & rsCodes("NXX"), rsCodes("NXX"))
NewItem.SubItems(1) = rsCodes("RC")
NewItem.SubItems(2) = rsCodes("State")
rsCodes.MoveNext
Loop
End Sub

The above code for a listbox occasionally runs across a null value in the rsCodes(RC) field. How would you suggest I skip any records containing null values in this field?
Next
Reply
Map
View

Click here to load this message in the networking platform