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

Subform listbox problem 1

Status
Not open for further replies.

ajking

Technical User
Aug 13, 2002
229
I have an subform on my main form. This sub form has 4 listboxes which are used to populate textboxes on the main form. This works fine but when I go to a new record and then enter the sub form, the listboxes have retained the selections from the previous record.
It's probably very simple but I am having a "friday brain dump"! TIA

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
That's the normal behavior for unbound listboxes, actually for any unbound control.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Sorry, Premature Submission! I assume you assign the value from the listbox to your textbox in the AfterUpdate of the listbox. This'll "reset" the listbox to it's original state.

Code:
Private Sub YourListBox_AfterUpdate()
 Me.YourTextBox = YourListBox
 YourListBox = ""
End Sub


The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Many thanks for your swift reply. I said it would be simple and that I was suffering a "friday brain dump"
cheers

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top