String manipulation of value in report text box

  • Thread starter Thread starter John Harrington
  • Start date Start date
J

John Harrington

I have a field in my RecordSource called Me.field containing a
string.

I have some code that I run this string through to do some rather
complex string manipulation.

I then want to put the result in a text box on my form.

So...

In the Load event of the form I do:

' Bunch of code here that manipulates Me.field and puts
' the result in the string variable called MyString

Me.MyTextBox.Value = MyString

This does not work.

How do I simply assign the value MyString to my text box?

Thanks,
John
 
John said:
I have a field in my RecordSource called Me.field containing a
string.

I have some code that I run this string through to do some rather
complex string manipulation.

I then want to put the result in a text box on my form.

So...

In the Load event of the form I do:

' Bunch of code here that manipulates Me.field and puts
' the result in the string variable called MyString

Me.MyTextBox.Value = MyString

This does not work.

How do I simply assign the value MyString to my text box?


You do it that way. What does "This does not work" mean?
 
First, this is a reports NG and your subject mentions Report but your
question suggests you are confused about forms.

"Field" is a bad bad name for anything in Access.

Is the text box bound or unbound? What is its control source?

Have you tried doing this in the On Current event?
 
First, this is a reports NG and your subject mentions Report but your
question suggests you are confused about forms.

"Field" is a bad bad name for anything in Access.

Yeah, I say "form" in my post, but I was being absentminded; I meant
report. Sorry. Thanks for your response.

Never mind, though; I think I figured it out simply by calling my
function in the Control Source of the text box. But now I have
another question, which is as follows:

Why is "field" a "bad bad" name for "anything in Access"? Given that
the word "field" is used by Microsoft in discussing fields in their
tables, does that mean that Microsoft has a bad naming convention for
fields? And if they shouldn't refer to fields as "fields", what
should they refer to fields as?


John
 
In your original message, you mentioned "called Me.field". This suggested
that you named a field or a control with the name "field". This would be like
naming your son "boy" rather than "John" or "Robert".

Generically you can refer to John or Robert as a "boy" or "son" but these
are not good names to give him at birth.
 
Back
Top