After Update

Jon123

Registered User.
Local time
Today, 08:04
Joined
Aug 29, 2003
Messages
668
I have code in the After Update property of a combobox. If I select a value
in the combobox the code runs. If I use code to update the combo box the after update code does not run. Is there a way to trigger the after update when using code to fill in combo box values?

jon
 
Call the combo's after update event.

If in the same form module:

ComboNameHere_AfterUpdate

otherwise, you have to change it from private to public and then call it:

Form_FormNameHere.ComboBoxName_AfterUpdateEvent
 
is this what it should look like

[Forms]![Frm-Adding All Parts Viewer].[Part Number].AfterUpdateEvent
 
i cant seem to make it work. It does not error but the afterupdate code never runs

???

jon
 
Actually do it this way:

Forms("Frm-Adding All Parts Viewer").Controls("Part Number").AfterUpdate

EDIT:Actually that won't work

It would be SO very easy if you didn't have spaces in the names.
 
I know I did not learn about spaces being real bad until later.

So what would the code look like with out spaces?

I can start changing the names

jon
 
I know I did not learn about spaces being real bad until later.

So what would the code look like with out spaces?

I can start changing the names

jon

Without spaces this should work if used exactly as shown.

Form_Frm-AddingAllPartsViewer.PartNumber_AfterUpdate
 
ok this is the code
Form_FrmAddingAllPartsviewer.Partnumber_AfterUpdate

When it runs I get a method or data member no found and the .Partnumber_AfterUpdate is highlighted????

jon
 
ok this is the code
Form_FrmAddingAllPartsviewer.Partnumber_AfterUpdate

When it runs I get a method or data member no found and the .Partnumber_AfterUpdate is highlighted????

jon

Did you remember to set the AfterUpdate event as PUBLIC instead of PRIVATE?
 
Yes this is thecode on the command button. The 1st line
fills the combo box then the next line should run the After Update
Right?


Public Sub part1_Click()
On Error GoTo Err_close_Click
Forms!FrmAddingAllPartsViewer.Partnumber = Me.pn1
Form_FrmAddingAllPartsviewer.Partnumber_AfterUpdate


jon
 
Yes this is thecode on the command button. The 1st line
fills the combo box then the next line should run the After Update
Right?


Public Sub part1_Click()
On Error GoTo Err_close_Click
Forms!FrmAddingAllPartsViewer.Partnumber = Me.pn1
Form_FrmAddingAllPartsviewer.Partnumber_AfterUpdate


jon

The part1_Click event shouldn't be PUBLIC. It is the AFTER UPDATE event that should be PUBLIC.
 
ok I think I follow

Code for the command button

Private Sub part1_Click()
On Error GoTo Err_close_Click
Forms!FrmAddingAllPartsViewer.Partnumber = Me.pn1
Forms_FrmAddingAllPartsviewer.PartNumber_AfterUpdate

Code in the After Update event property for the field PartNumber

Public Sub PartNumber_AfterUpdate()
[Forms]![FrmAddingAllPartsViewer].[Part Description] = [Forms]![FrmAddingAllPartsViewer].[Partnumber].Column(1)
 
This thing is driving me crazy. I cant seem to get the After Update to fire at all.
 
Its pretty huge I will need to slim it down alot. I will see if I can.

Also does it matter if the Combo box is a bound field?

jon
 
Also does it matter if the Combo box is a bound field?
No, it wouldn't.

If you can't post it, you might email it to me. I can PM you an email address. But it will take longer for me to get to as I will have to wait until I get home in about 10 hours or so.
 
ok I have slimed it down pretty far so alot wont make much sense but you can see where I'm stuck.

If you open the dbase and open form Frm-Viewer

from here click the command button "Add Process Kit Parts"
This should open the form "FrmAddingAllPartsViewer"
now click the command button "part1" which is right
next to the part number on the Frm-viewer this should update
the part number field on the "FrmAddingAllPartsViewer" and
then trigger the After Update Event and should hit the STOP code
but it never gets there????

jon
Thank you for your time looking thru this.
 

Attachments

sorry, I'll still have to wait until I get home (unless someone else does it before then) as I didn't mention that I do not have 2007 here at work.
 

Users who are viewing this thread

Back
Top Bottom