refreshing a combo

bennybee

Registered User.
Local time
Today, 23:55
Joined
Jan 13, 2004
Messages
50
I select a value in Combo1, and it cascades the values in Combo2.

however, Combo2, is not refreshed until i close down the form and reopen it again.

is there a way of refreshing Combo2, once i make a selection in Combo1?

for instance using the OnUpdate event for Combo1.
but i dont know what im supposed to execute on this event...

someone please help?:(
 
bb,

Use the AfterUpdate of combo1 to:

Me.Combo2.Requery

Wayne
 
:(
that doesnt seem to work.

it still wont change the values in combo2, unless i close down the form and reopen it again.

this is the code that im using:

Private Sub Meeting_Number_AfterUpdate()
Me.Meeting_Infor.Requery
End Sub

when the user selects a meeting number, in another combo box, it displays items related to that meeting.
but at the moment - it doesnt update, unless i close down the form and reopen it. :(
 
bb,

After an entry is made in Combo1:

Me.Combo2.RowSource = "Select ... Where SomeField = " & Combo1
Me.Combo2.Requery

I don't know exactly what your sql should be, but it should
reference Combo1.

That should be all that you have to do.

Wayne
 
Wayne,

I think that i may be missing a step still.

I have an initial query that just runs not based on any criteria set in the form.
however, i have a second query running on that query which IS based on the value of a combo box.

so i think that i need to get my query to requery, and then the combo to update.? no?

so i have this code:
Private Sub Meeting_Number_AfterUpdate()
Me.Meeting_Infor.RowSource = "Meeting_Agenda Query Query"
Me.Meeting_Infor.Requery
End Sub

but i think that i need to get the query to requery before i change the rowsource dont i?
so how do i get that to happen, for the query to requery itself based on the selection in the combo 1,
and then i can change the rowsource, and requery the Meetin_Infor field.

im having a stab in the dark here but maybe:

Me.[Query]![Meeting_Agenda Query Query].Requery

or something like that.

thanks for your patience...
 
bb,

Since the rowsource is based on a query, you should only need
to requery the combo.

Can you:
Tools --> Database Utilities --> Compact/Repair
ZIP the database
And post it here.

Wayne
 
Here it is.

the form that im interested in is the one called 'Hearing Agenda'.

when you look at it, the combo box which you need to change is the one down the bottom called 'Meeting Number'.
its supposed to change the value in the 'Meeting Info' box.

the meeting info box is based on the query - "Meeting_Agenda Query Query",

if you can have a look and see whether you can get it updating that would be sweet.

the file size of the database is a little too big. is 104kb.
can i email it to you?? please?
 
it has been emailed...

thanks for all your help..
bb
 
benny,

You need to change your query so that MeetingNumber has
the criteria:

[Forms]![Hearing_Agenda]![Meeting_Number]

That way it uses the combo on your form.

If you wanted to move through them, they would be unbound
and both of them would be referenced in the form's query.

The only code you need is:
Code:
Private Sub Meeting_Number_AfterUpdate()
  Me.Meeting_Infor.Requery
End Sub

Also, I hope that you don't think that you're navigating around
your data with these combos. They just change the contents
of the current record, not move through them.

btw, Meeting number 9 is the only MeetingNumber selection
that will return any valid data.

Wayne
 

Users who are viewing this thread

Back
Top Bottom