Blank Listbox

J

Joy

Hi,
I have a database in Access 2003 split into a front and back-end.

On the opening form of the front-end, there is a tab control that has an
unbound listbox in it. If the table links are broken, there is VBA code
called from the opening form that re-links the tables and continues to open
the form.

My problem is when the links are refreshed with the code and the form opens
the listbox in the tab control is blank. If I close the database and reopen
it or change the form view to design view then back to form view, the
listbox is fine and is populated correctly.

Can anyone tell my why?

Thanks in advance.
Joy
 
A

Al Campagna

Joy,
My question would be... why would the links be broken?
Also, seeing the exact "re-linking" code you refer to would be helpful.

But... just off the top, it sounds like the code you refer to isn't
doing a listbox Requery after the link is refreshed.
By going into design mode, and then re-opening the form, your just
manually forcing a listbox Requery.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
J

Joy

Al, Thanks!!
The light bulb just lit. Your comment about the listbox Requery did it and
I can't believe I didn't think of such a logical solution.

Regarding you question as to why the links would be broken...as I would do
improvements/modifications on the database for a client, I email it back to
them. It's linked to tables on my PC but the VBA code that refreshes the
links has a string connection to their backend path.

I can't thank you enough for your reply and it was so prompt.
Joy

PS - I feel really stupid. I won't tell you how much time I spent on
researching the problem.
 
A

Al Campagna

Joy,
No problem at all.
I would, however, question the need for any code that is developed
purely for a possible "un-linked" condition.
For a large app, that would be a lot of extra coding.
Your end user should be re-linking your front ends to their back end...
before running or testing the app.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Access Form Refresh 1
Cannot Get ListBox .ItemsSelected, help! 1
Access Cannot select items in listbox 1
Listbox SQL problem 2
Listbox Double Vision 6
Update listbox on a tab 2
Unable to select row in listbox 12
Requery not working 8

Top