G
Gary
I am having a problem getting a macro and function to work together.
I have Field_One where a string gets entered. I want Field_Two to
contain the same string with the spaces replaced by underscores in a
form.
I have a simple SetValue Macro for Field_One which will place the
string from Field_One into Field_Two on exiting the control. Works
fine.
I have a Function (found on the group) which will do the replace, but
I can't get it to happen automatically.
----
With Me.Field_Two
.Value = Replace(.Value, " ", "_")
End With
----
Field_Two has [Event Procedure] set for On Change. I thought that the
Macro making the change would trigger the function butIt doesn't.
Also tried On Dirty.
Clearly, I am lacking the fundamentals here. Can someone show me how
to make this work? Even a completely different approach would be
fine.
TIA
gary
I have Field_One where a string gets entered. I want Field_Two to
contain the same string with the spaces replaced by underscores in a
form.
I have a simple SetValue Macro for Field_One which will place the
string from Field_One into Field_Two on exiting the control. Works
fine.
I have a Function (found on the group) which will do the replace, but
I can't get it to happen automatically.
----
With Me.Field_Two
.Value = Replace(.Value, " ", "_")
End With
----
Field_Two has [Event Procedure] set for On Change. I thought that the
Macro making the change would trigger the function butIt doesn't.
Also tried On Dirty.
Clearly, I am lacking the fundamentals here. Can someone show me how
to make this work? Even a completely different approach would be
fine.
TIA
gary