Combo sync-ing to form after setvalue of Maco

  • Thread starter Thread starter bois
  • Start date Start date
B

bois

I am having trouble getting a unbound combo box to synch
with the rest of the form after updating it value via a
Macro and or simple event code. This is what my form look
like.

Form: Main
Subform: Sub1 with an bound text box: Departments; and
a combo box: people1
Subform: Sub2 unbound Combo box: people2
(note the two subforms are at the same level)

What I want to do is when I click on the "Departments"
text box I want to update the Subform Sub2 unbound combo
box "people2" with the value in Subform: Sub1 combo
box "people1"

Using either a Macro with the setVale function or the
Click EVENT running the following code Form![Main]!
[Sub2].Form![people2]=Me.people1. I can set the value of
the the combo box ComboSub2 to what I want; then the
trouble starts. Normally when I update the combo box by
using the mouse, code run from the "After Update" event
property and sync the combo box "people2" to the rest of
the Form sub2. Updating the combox "people2" via Macro or
Code the "AfterUpdate" does not run!!!

I tried lots of things and nothing works. I even added a
command button on sub2 that runs the same code the combo
box "people2' does, but I could not find now to programing
make it run.

This is the code that run on the "AfterUpdate" Event
property of combo "People2"
Dim rs As Object
Set rs=Me.Recordset.Clone
rs.FindFirst "[KeyE]= "& str(Me![people2])
Me.Bookmark=rs.Bookmark

My question is how can I get the form sub2 to sync with
the the combo box people2 on Sub2. I would like not to use
a filter.

Bois
 
You're welcome.

Bois said:
It worked great!!!!! Thanks is not enough for all the time
you have saved me, but thank you very much I greatly
appricated you time and skill.
Bois
-----Original Message-----
If all you want to do is to run the code that is in the AfterUpdate event of
the combo box, simply call that procedure via code:

Call Form_SubformFormName.cboBoxName_AfterUpdate()

where SubformFormName is the actual name of the form that is serving as the
subform, and cboBoxName is the name of the combo box on that subform whose
code you wish to run.

--
Ken Snell
<MS ACCESS MVP>

bois said:
I am having trouble getting a unbound combo box to synch
with the rest of the form after updating it value via a
Macro and or simple event code. This is what my form look
like.

Form: Main
Subform: Sub1 with an bound text box: Departments; and
a combo box: people1
Subform: Sub2 unbound Combo box: people2
(note the two subforms are at the same level)

What I want to do is when I click on the "Departments"
text box I want to update the Subform Sub2 unbound combo
box "people2" with the value in Subform: Sub1 combo
box "people1"

Using either a Macro with the setVale function or the
Click EVENT running the following code Form![Main]!
[Sub2].Form![people2]=Me.people1. I can set the value of
the the combo box ComboSub2 to what I want; then the
trouble starts. Normally when I update the combo box by
using the mouse, code run from the "After Update" event
property and sync the combo box "people2" to the rest of
the Form sub2. Updating the combox "people2" via Macro or
Code the "AfterUpdate" does not run!!!

I tried lots of things and nothing works. I even added a
command button on sub2 that runs the same code the combo
box "people2' does, but I could not find now to programing
make it run.

This is the code that run on the "AfterUpdate" Event
property of combo "People2"
Dim rs As Object
Set rs=Me.Recordset.Clone
rs.FindFirst "[KeyE]= "& str(Me![people2])
Me.Bookmark=rs.Bookmark

My question is how can I get the form sub2 to sync with
the the combo box people2 on Sub2. I would like not to use
a filter.

Bois


.
 
Back
Top