Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving null values from Access db

Status
Not open for further replies.

snorky

Programmer
Jun 5, 2001
58
GB
I have a VB program that retrieves values from an Access db using the format

frm_main.lst_names.additem adorecordset!Names

If there is not an entry in the db the program fails on
94 - Invalid Use of Null
Do I HAVE to have an entry (even a dummy one ) to stop this or is there a simple way round it ( other than error trapping it ) ????

Snorkx :-9
 
Dear snorkx,
try this:

frm_main.lst_names.additem iif(isnull(adorecordset!Names);"N/A";adorecordset!Names)

You can put into that string whatever you want.
but better would be probably not to add it to the list at all:
like this

if not isnull(adorecordset!Names) then
frm_main.lst_names.additem adorecordset!Names
end if


regards Astrid
 
Excellent - that covers what I needed - simple huh ? Thanx !
:-9
 
dear snorky,

things that are known are allways simple. All the others are mostly really tricky.

pleased to have helped you

Regards Astrid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top