String manipulation of value in report text box

  • Thread starter John Harrington
  • 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
 
M

Marshall Barton

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?
 
D

Duane Hookom

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?
 
J

John Harrington

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
 
D

Duane Hookom

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top