Add ONE variable word to report header

  • Thread starter Ann Scharpf via AccessMonster.com
  • Start date
A

Ann Scharpf

I saw a post from Larry Linson (text immediately below) and tried to use it
without the If part because I never want the message box to appear on print.
When I tried this, Access just hung. Am I on the right track at all?

Put VBA code in the Print event to evaluate the condition and set the
Visible property of the Control... something like

If <whateveryourcondition> Then
Me!txtYourBox.Visible = True
Else
Me!txtYourBox.Visible = False
End If

Larry Linson
Microsoft Access MVP





Ann Scharpf via AccessMonster.com said:
Marshall:

This works fine but when you PRINT the report, the message box appears again.
Is it possible to get the message box to appear only when you click the
button to create the report but not when you print it?

Ann

Marshall said:
="Report of whatever this is " & IIf(MsgBox("Is Revision",
4) = 6, "<Revision>", "")

The missing quote was between "Is Revision and the comma.

The reasons I suggested using the MsgBox instead of a prompt
string is because the Message box can be made to use Yes and
No buttons and because the user does not have to type
anything.
Ah, now that I look at things again (I was pretty tired on Friday afternoon)
I see that I DIDN'T use your solution. I used the one I linked to in my 2nd
[quoted text clipped - 43 lines]
would need to use Klatuu's idea, which, except for your lack
of VBA skills, is better all the way around.
 
M

Marshall Barton

I don't see how Larry's answer to someone else's question
can be used in your situation.

If you'll remember way back in this thread, I said this was
a quick and dirty way to get what you wanted. Well, you
just saw the dirty side of it.

Not too far back I also said that Klatuu's idea was the
better way to go and this problem is why I said that.

Actually, I think the best way to do this involves using a
form with buttons to open the report and a check box or
something to specify whether its a revision or not. How
ever, that's not what you asked for and may involve too many
new concepts for you to get a grip on until you gain more
experience with using a form to control viewing/printing
reports.
--
Marsh
MVP [MS Access]


Ann said:
I saw a post from Larry Linson (text immediately below) and tried to use it
without the If part because I never want the message box to appear on print.
When I tried this, Access just hung. Am I on the right track at all?

Put VBA code in the Print event to evaluate the condition and set the
Visible property of the Control... something like

If <whateveryourcondition> Then
Me!txtYourBox.Visible = True
Else
Me!txtYourBox.Visible = False
End If


Ann Scharpf via AccessMonster.com said:
This works fine but when you PRINT the report, the message box appears again.
Is it possible to get the message box to appear only when you click the
button to create the report but not when you print it?


Marshall said:
="Report of whatever this is " & IIf(MsgBox("Is Revision",
4) = 6, "<Revision>", "")

The missing quote was between "Is Revision and the comma.

The reasons I suggested using the MsgBox instead of a prompt
string is because the Message box can be made to use Yes and
No buttons and because the user does not have to type
anything.
Ah, now that I look at things again (I was pretty tired on Friday afternoon)
I see that I DIDN'T use your solution. I used the one I linked to in my 2nd
[quoted text clipped - 43 lines]
would need to use Klatuu's idea, which, except for your lack
of VBA skills, is better all the way around.
 
A

Ann Scharpf via AccessMonster.com

I thought that maybe setting the "make box visible" to false would make the
box not appear. Obviously, I was wrong.

Marshall said:
I don't see how Larry's answer to someone else's question
can be used in your situation.

If you'll remember way back in this thread, I said this was
a quick and dirty way to get what you wanted. Well, you
just saw the dirty side of it.

Not too far back I also said that Klatuu's idea was the
better way to go and this problem is why I said that.

Actually, I think the best way to do this involves using a
form with buttons to open the report and a check box or
something to specify whether its a revision or not. How
ever, that's not what you asked for and may involve too many
new concepts for you to get a grip on until you gain more
experience with using a form to control viewing/printing
reports.
I saw a post from Larry Linson (text immediately below) and tried to use it
without the If part because I never want the message box to appear on print.
[quoted text clipped - 27 lines]
 
M

Marshall Barton

Well, it's not completely wrong. It just involves another
mechanism and doesn't simplify the situation.

Keep in mind what I said about using a form to setup for and
open the report. When you get to the point where that
becomes a comfortable mechanism, this whole situation should
become a lot clearer.
--
Marsh
MVP [MS Access]

I thought that maybe setting the "make box visible" to false would make the
box not appear. Obviously, I was wrong.

Marshall said:
I don't see how Larry's answer to someone else's question
can be used in your situation.

If you'll remember way back in this thread, I said this was
a quick and dirty way to get what you wanted. Well, you
just saw the dirty side of it.

Not too far back I also said that Klatuu's idea was the
better way to go and this problem is why I said that.

Actually, I think the best way to do this involves using a
form with buttons to open the report and a check box or
something to specify whether its a revision or not. How
ever, that's not what you asked for and may involve too many
new concepts for you to get a grip on until you gain more
experience with using a form to control viewing/printing
reports.
I saw a post from Larry Linson (text immediately below) and tried to use it
without the If part because I never want the message box to appear on print.
[quoted text clipped - 27 lines]
would need to use Klatuu's idea, which, except for your lack
of VBA skills, is better all the way around.
 

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