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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listbox not listing until back and forth access97

Status
Not open for further replies.

bilbo66

Technical User
May 27, 2001
6
GB
Hi,
I have an odd problem, to do with a new record on a form using autonumber.
Simply put I have two listboxes:
A selection from one is inserted into a table via a command button and SQL query.
I use a value in a text box (record number) which I tie in with the SQL query to update my database.
My other listbox is used to display values from my updated table.
This is requeryed after my SQL insert.
This all works fine...... until I enter a new record.
The listbox just doesn't display anything.
I thought at first it could be because the new number (autonumber) on the record might not be defined at first, but it is, as my table is updated with the new entrie/s. The problem is that even if I force the listbox to requery it shows nothing, but if I flip back and forth through the records the listbox functions correctly.
Am I missing something simple?

Other bits:

Using Access 97.
On form load I populate the listbox.
On form Current I update the listbox.
After my SQL insert I update the listbox.
I don't actually have the sql string in the recordsource property box, I use a subroutine to do this.

Any help?
Cheers,
Bill.
 
On current event on your form can help you, just add a refresh or something

JJ
 
Hi,
I am using the Form_Current() event already.
This updates the record when moving from one record to the other, however this isn't the problem.
Bill.
 
Hi,
I am using the Form_Current() event already.
This updates the listbox when moving from one record to the other, however this isn't the problem.
Bill.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top