Changing field names for a report

  • Thread starter Afrosheen via AccessMonster.com
  • Start date
A

Afrosheen via AccessMonster.com

Thanks again for reading this.
I have this statement in textbox1: =[lname] & ", " & [fname] & " ----" &
[workplan]

What I'd like to be able to do is change the name of the "workplan" to
something else.
Can that be done like this in the On Open?

select case flg
case "Interim"
me.textbox1 = "=[lname] & ", " & [fname] & " ----" & [interim]"
end select

I think I can do this but I'm not sure so I thought I'd better get it checked
out.

Thanks again. Many Ditos
 
J

John Spencer MVP

Yes, you can HOWEVER your code will not do what you want.

Try something along the lines of the following.

me.textbox1.ControlSource = "=[lname] & ", " & [fname] & " ----" & [interim]"

Now, satisify my curiousity. Why did you post this question? It would have
been faster and simpler to test your idea and see if it worked or not. If it
failed and you could not see why, then I would expect to see you post.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
A

Afrosheen via AccessMonster.com

Sorry John, I didn't know if I could back out or not. I'll have to think
things through better.

By The Way. It didn't work. I created a text box and left the control source
clear. Then on open I have the case statement

Me.Text1.ControlSource = "=[lname] & "", "" & [fname] & "" ---- "" & [interim]
"

Yes, you can HOWEVER your code will not do what you want.

Try something along the lines of the following.

me.textbox1.ControlSource = "=[lname] & ", " & [fname] & " ----" & [interim]"

Now, satisify my curiousity. Why did you post this question? It would have
been faster and simpler to test your idea and see if it worked or not. If it
failed and you could not see why, then I would expect to see you post.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Thanks again for reading this.
I have this statement in textbox1: =[lname] & ", " & [fname] & " ----" &
[quoted text clipped - 13 lines]
Thanks again. Many Ditos
 
J

John Spencer MVP

You need to put the code in the format event of the section that contains
Text1. Putting it in the Open event is too early since the value of interim
(a field?) is not available in report's open event.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Sorry John, I didn't know if I could back out or not. I'll have to think
things through better.

By The Way. It didn't work. I created a text box and left the control source
clear. Then on open I have the case statement

Me.Text1.ControlSource = "=[lname] & "", "" & [fname] & "" ---- "" & [interim]
"

Yes, you can HOWEVER your code will not do what you want.

Try something along the lines of the following.

me.textbox1.ControlSource = "=[lname] & ", " & [fname] & " ----" & [interim]"

Now, satisify my curiousity. Why did you post this question? It would have
been faster and simpler to test your idea and see if it worked or not. If it
failed and you could not see why, then I would expect to see you post.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Thanks again for reading this.
I have this statement in textbox1: =[lname] & ", " & [fname] & " ----" &
[quoted text clipped - 13 lines]
Thanks again. Many Ditos
 
A

Afrosheen via AccessMonster.com

Ok. Thanks for your help. I'll keep working on it.

You need to put the code in the format event of the section that contains
Text1. Putting it in the Open event is too early since the value of interim
(a field?) is not available in report's open event.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Sorry John, I didn't know if I could back out or not. I'll have to think
things through better.
[quoted text clipped - 24 lines]
[quoted text clipped - 13 lines]
Thanks again. Many Ditos
 

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