Event OnChange AfterUpdate not start when change in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have Access 2003 spanish versión, and when I change the value of a text
box in code (VBA) the envents OnChange and enymore event don't start.

Thank you.
 
Hello,
I have Access 2003 spanish versión, and when I change the value of a text
box in code (VBA) the envents OnChange and enymore event don't start.
fell yourself lucky that it doesn't start (imagine you change the
recordsource and every event would start)

after changing you value write

mytextbox_OnChange and it will run this sub
 
OnChange Event only occurs when the change is done through the GUI. It
doesn't fire when you change the Value by code.

However, you can simply call the OnChange Event by code (after you change
the value with the simple statement:

Call YourTextBox_Change

(you can even omit the word "Call") to run the code in this Event Procedure.
 
Thank you Van,
I tried this befor, but it's not works for my for this reason:
I call a Form Calendar wich put a selected date in a textbox. This text box
Nº1 has a date value, wich could be major or minor of anoter date in TextBox
Nº2 . If TextBoxNº1 date is minor that TextBoxNº2 date then TextBoxNº2 Date =
TextBoxNº1 date.
in the code above, the call of event is after opening the Form Caledario,
but the form Calendario execute last, becouse first has to finish actual
event.

I try the same scenario in Delphi 2005 and there OnChange event raise when I
change the textbox value in the code.


********************** cut *****************
Private Sub cmdCalendarioInicio_Click()
Dim StrCalendario As String


DoCmd.OpenForm "Calendario", , , StrCalendario
Forms![Calendario].Origen = Me.txtFechaInicio
Call txtFechaInicio_AfterUpdate

End Sub
********** end cut ************************+
 
Hi Andi,
I think that the purpose for OnChange event is when is change in the text
box, is to raise.
I Delphi 2005 enviromnt I try this scenario and works fine.
I think there is some bug.
 
Sorry, I don't follow what you meant by major or minor date.

What I would suggest is to put a MsgBox statement at the start of the
txtFechaInicio_AfterUpdate Event Procedure and see if the code execution
gets to the Procedure and trace the code step by step.
 
Hi Andi,
I think that the purpose for OnChange event is when is change in the text
box, is to raise.
I Delphi 2005 enviromnt I try this scenario and works fine.
I think there is some bug.

forget how it works in Delphi, you are in VBA and this is different
 
Back
Top