updating the contents of a subform from an unbound listbox 
Author Message
 updating the contents of a subform from an unbound listbox

I have a set of records, students needs statements, which are each
identified by a subject area. On a form, I have an unbound listbox with a
list of subjects. When I select a subject, the query selects just the
relevant records. I have a subform below the listbox which show the results
of the query. I would like these records to change when the listbox value
changes.
How can I get the subform to reflect the changes immediately, as soon as the
listbox is updated?

Many thanks,
Peter



Thu, 15 May 2003 03:00:00 GMT  
 updating the contents of a subform from an unbound listbox
You need to add some code in the after update event of the listbox to
"Requery" the subform.

    Me.subformControlName.Requery

Duane


| I have a set of records, students needs statements, which are each
| identified by a subject area. On a form, I have an unbound listbox with a
| list of subjects. When I select a subject, the query selects just the
| relevant records. I have a subform below the listbox which show the
results
| of the query. I would like these records to change when the listbox value
| changes.
| How can I get the subform to reflect the changes immediately, as soon as
the
| listbox is updated?
|
| Many thanks,
| Peter
|
|



Thu, 15 May 2003 03:00:00 GMT  
 updating the contents of a subform from an unbound listbox
On the listbox properties, go to Events tab, and for After Update, select [Event
Procedure] and use something like this:

Private Sub Listbox_AfterUpdate()

'after a change in the value of listbox, requery the subform
Me![name_of_subform].Requery

End Sub

Quote:
-----Original Message-----

I have a set of records, students needs statements, which are each
identified by a subject area. On a form, I have an unbound listbox with a
list of subjects. When I select a subject, the query selects just the
relevant records. I have a subform below the listbox which show the results
of the query. I would like these records to change when the listbox value
changes.
How can I get the subform to reflect the changes immediately, as soon as the
listbox is updated?

Many thanks,
Peter

.



Sat, 17 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. move data from unbound boxes to subform controls

2. ?Present a queryresult in an unbound subform??

3. Help ADO and Unbound subForm

4. Write contents of listbox to text file/populate listbox from text file

5. HELP! Filling unbound listbox w/lg data

6. formatting rows and columns in unbound data control, rich text box control, or listbox control

7. navigating recordsets with listbox control, bound or unbound

8. updating a field in a form from a subform

9. Subform update

10. VBA Update Of Unbound Object Frame

11. Update a Bound field with data from unbound field

12. updating subform

 

 
Powered by phpBB® Forum Software