Data IO problems with listboxes. Help!

  • Thread starter Thread starter Phil Jones
  • Start date Start date
P

Phil Jones

My application is deployed over a highly-secure, encrypted wide area network
and linked to a SQL Server DB, via an ODBC file data source.

Sometimes, specific columns in my listboxes will not populate. The list
will populate, but one or more columns will display blank. I assume this
is due to slow network performance. Refreshing the list usually fixes the
problem. I first thought that the data was there, just not painted on the
screen. However, sometimes when you select an item from the list and click
the view details button, if the bound column happens to be blank, the
listbox value returns null or zero, thus causing an error.

Can anyone say what is causing this? I'm assuming that the data is slow or
late getting there and the listbox times out? Is there a setting in Access
that I can tweak to make this preform better.

I'm thinking of adding code to check for this condition. Try to detect the
condition and force the list to requery itself prior to executing the
dependent command. Something like this:

If Me.listbox.Listcount > 0 AND IsNull(me.listbox.value) 'there are items
in the list, but the list has no value
Me.ListBox.Requery
End if

If anyone has experience deploying Access apps over a wide area network I
would appreciate your help.

Thanks,

PJ
 
PJ,
You can loop through all the listbox "cells" (all columns on all rows) using
the Column(lngIndex, lngRow) style loops.

**Air code**
dim lngIndex as long
dim lngRow as long
dim ysnRefreshFlag as boolean

for lngIndex =0 to me.listbox.ListCount -1
for lngRow = 0 to 5 'Assuming you have six columns
if me.listbox.Column(lngIndex, lngRow) & "" = "" then
ysnRefreshFlag=True
end if
next
next

if ysnRefreshFlag then
me.listbox.requery
end if

**end code**

As for the cause I have no clue - probably just regular network/ms access
wierdness.

Hope this gives you some ideas,
Mattias Jonsson
 
Back
Top