Visible/Invisible

goaksmith

Registered User.
Local time
Today, 08:13
Joined
Jul 31, 2002
Messages
74
*I have a form where if the word "SEI" appears in a certain field a command button will appear. This command button will appear after this field is updated and on the on current event of the form.
*However, sometimes this field is not updated manually. Most of the time this field is input using a macro which automatically fills the field.
*When this is done the command button won't appear until after I leave the record and come back in (basically the on current)

My question is: Is there a to make the macro updating the field trigger the visible/invisible event?
 
You need to call your second macro to set visibility from the OnChange event of your text field on the form. See help under 'OnChange'.
 
The macro that I have now puts info in a field. And according to the Help you have to type the information in for the on change event to work. So how will this be different than after update?? Or am I missing something. Here is what help says--

Setting the value of a control by using a macro or Visual Basic doesn't trigger this event for the control. You must type the data directly into the control, or set the control's Text property.
 
The OnChange event will only be called if you actually set the Text property of the field you are setting.

Few things to note, the text box has to be enabled and visible and it has to have the focus to use the text property to set the value. The following code would work.

Me!YourTextBox.SetFocus
Me!YourTextBox.Text = "Whatever text you require"

If you put code or a macro behind the OnChange for 'YourTextBox' it will be triggered directly after the .Text line above.
 

Users who are viewing this thread

Back
Top Bottom