Trigger event on value change

JIK

New member
Local time
Today, 09:21
Joined
Jan 26, 2013
Messages
3
Hi All

I have a form (frmClientList) that contains a list box (ctlClientList) showing records from a table (tblClientList). For the list box, I have an onClick event that:
1. sets a TempVar called tmpClientNumber containing the record ID from the list box
2. closes the form.

Another form (frmClientInvoices) is already open and has a text box control (ctlChosenClient) whose source is the TempVar:

Control Source =[TempVars]![tmpClientNumber]

ctlChosenClient updates perfectly whenever the TempVar is set.

However, I need to trigger an event whenever ctlChosenClient changes. I have tried AfterUpdate and OnChange but neither work because the control’s content is being changed programmatically and not manually. I also can’t set the focus to ctlChosenClient from frmClientList as it produces an error.

So my quandary is… how can I trigger an event whenever the value of a text box changes programmatically? :confused:

Any help appreciated!
 
When changing the value of a control programmatically, events of that control do not fire, as opposed to the fact that they do when the change is manual. That's just the way it is. Therefore you have to call the procedure explicitly. Call ctlChosenClient_AfterUpdate immediately after you modify its value programmatically.
 

Users who are viewing this thread

Back
Top Bottom