Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 86,374 VB Programmers. There are 1,421 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a VB Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

combobox

 
Reply to this topicStart new topic

combobox

emkaye
post 7 May, 2008 - 11:21 PM
Post #1


New D.I.C Head

*
Joined: 12 Aug, 2007
Posts: 28



iam retrieving a list of employer from my database and then it will be listed in a combobox (cboemployer). Below is my code:

CODE

cboEmployer.Clear
EmployerList = ("select * from tblAgencyInfo ORDER BY EMPLOYER ASC")
Set EmployerListRS = myConn.Execute(EmployerList)

EmployerListRS.MoveFirst
Do Until EmployerListRS.EOF
    cboEmployer.AddItem EmployerListRS("EMPLOYER")
    
EmployerListRS.MoveNext
Loop


the list of employers are listed but an error occured. It says that :

Invalid use of Null.

Is there any problem with my code?
Please help.
Thanks.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


born2c0de
post 8 May, 2008 - 06:37 AM
Post #2


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,298

This happens when one of the tuples has its Employer Attribute as Null.

I don't know how to avoid this error so I use a workaround like this.

vb

Private Sub whatever()
On Error Goto null_handler

' Code

Exit Sub
null_handler:
' If the error message is "Invalid Use of Null" Then
Resume Next
'Else
' Handle the error appropriately.
End Sub


You could use an On Error Resume Next statement too, but you should refrain from using it as every error would be ignored.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 02:48AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month