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

Listbox refresh problem...

Status
Not open for further replies.

Frank123

MIS
Sep 17, 2001
77
US
I've got 2 DTC listboxes in a Parent/child relationship format. Everything works good except when you hit Back on the browser the "parent" listbox doesn't refresh, yet the "child" listbox refreshes. I had this problem for a while now and can't seem to figure it out. Here's the code I have in the on change event for the listboxes:

'Parent listbox
Sub Listbox1_onchange()
Recordset2.close
Listbox2.clear()
num = listbox1.gettext()
query1 = "SELECT system from main where site = '" & num &"' ORDER BY system"
Recordset2.setSQLText query1

Recordset2.open()

Listbox2_onchange()
end sub

-------------------------------
'Child listbox

Sub Listbox2_onchange()
Recordset3.close

num1 = listbox1.gettext()
num2 = listbox2.getText()

query3 = "SELECT * from main where site = '" & num1 &"' and system = '" & num2 &"'"
Recordset3.setSQLText query3

Recordset3.open()
end sub

---------------

If any of you can give me any suggestions I'd appreciate it. Thanks U.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top