Requery Issue

rjackson

New Member
Joined
Apr 26, 2011
Messages
6
2nd time poster here but very helpful site. I have a project I am working on and have 2 comboboxes cascading (AdminCombo and AccountCombo)to display a set of records on the same form, no subforms. Boxes are working fine and the data comes up fine with my selection but when I created the 2nd box I used the wizard and chose the 3rd option "Find a record on my form based on the value I selected in my combo box" and it created an embedded macro that i converted to vba so I could add the requery code in the after update code but it is not working. Here is the code that was converted to vba. I have tried adding AdminCombo.requery and me.AdminCombo.requery too but the data in the second combobox does not change.

Private Sub AccountCombo_AfterUpdate()
On Error GoTo AccountCombo_AfterUpdate_Err
DoCmd.SearchForRecord , "", acFirst, "[EventAccount_Account] = " & "'" & Screen.ActiveControl & "'"
AccountCombo_AfterUpdate_Exit:
Exit Sub
AccountCombo_AfterUpdate_Err:
MsgBox Error$
Resume AccountCombo_AfterUpdate_Exit
End Sub


Any suggestions would be great.

Thanks,
rj
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try using Me.Requery to refresh the whole form.
 
Upvote 0
Just tried that this morning and still not refreshing the first combobox. I am putting the code just before end sub.

Thanks,
rj
 
Upvote 0
I don't get why you would requery the first combo from the second. That isn't the way it is supposed to work in a Cascading Combo situation. You would requery the SECOND combo in the first's After Update event, not the other way around.
 
Upvote 0
No change to the combobox and it stops the records from changing to the record that was selected in the 2nd combobox.
 
Upvote 0
I don't get why you would requery the first combo from the second. That isn't the way it is supposed to work in a Cascading Combo situation. You would requery the SECOND combo in the first's After Update event, not the other way around.

Damnit man....thanks. Bassakwards I had it. Thanks for the obvious. :D
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,334
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top