make logo show...

  • Thread starter stephendeloach via AccessMonster.com
  • Start date
S

stephendeloach via AccessMonster.com

I have a report that draws the CompanyFrm from the form. I need the report to
know when TSWS, Inc is selected the TSWS, Inc. logo show up in the report
instead of the address... Can someone help me? Thanks
 
A

Al Campagna

stephendeloach ,
Use the OnFormat event of whatever section of the report your Address
and Logo are located.
Aircode... (use your own control names)
If Forms!YourFormName!CompanyName = "TSWS, Inc" Then
' Hide the Address fields (Visible = False)
' Show the Logo (Normally invisible... Visible = True
--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."
 
S

stephendeloach via AccessMonster.com

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
If Forms!DrillingInvoice!CompanyFrom = "TSWS, Inc" Then
' Hide the Address fields (Visible = False)
' Show the Logo (Normally invisible... Visible = True

End If
End Sub
This is what i typed in. I forgot to say. My report is run from the Drilling
Invoice query... How is my report going to know where the Logo is? As of now
I have 2 seperate reports, one with the logo in it and one with the logo not
in it. I get a runtime error 2450. Access cant find the form
"DrillingInvoice".... thanks
 
A

Al Campagna

stephendeloach,
"Aircode" means that the code is not actual, but just a reference to the
concept of what your actual code should do.
' Hide the Address fields (Visible = False)
' Show the Logo (Normally invisible... Visible = True
are two comments that describe what your code should do... not the actual
code itself.
Your form, with the CompanyFrom value should be open when you run the
report.
The reason your trying to create this code is to not have 2 reports (one
with logo and one without)
Copy and paste the logo onto report1, and make it invisible... and your
CompanyAddress field/s visible.

Try this (use your own names, but in this code, I'll assume your fields on
the report are... CompanyAddress and CompanyLogo)

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
If Forms!DrillingInvoice!CompanyFrom = "TSWS, Inc" Then
CompanyAddress.Visible = False
CompanyLogo.Visible = True
End If
End Sub
--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."
 
S

stephendeloach via AccessMonster.com

It says it cant find form DrillingInvoice?? I have tried to replace it with
everything. My form is named Drilling Invoice..tried that, didnt work, the
record source of the form is Table1, tried that, didnt work... any
suggestions?
thanks

Al said:
stephendeloach,
"Aircode" means that the code is not actual, but just a reference to the
concept of what your actual code should do.
' Hide the Address fields (Visible = False)
' Show the Logo (Normally invisible... Visible = True
are two comments that describe what your code should do... not the actual
code itself.
Your form, with the CompanyFrom value should be open when you run the
report.
The reason your trying to create this code is to not have 2 reports (one
with logo and one without)
Copy and paste the logo onto report1, and make it invisible... and your
CompanyAddress field/s visible.

Try this (use your own names, but in this code, I'll assume your fields on
the report are... CompanyAddress and CompanyLogo)

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
If Forms!DrillingInvoice!CompanyFrom = "TSWS, Inc" Then
CompanyAddress.Visible = False
CompanyLogo.Visible = True
End If
End Sub
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
If Forms!DrillingInvoice!CompanyFrom = "TSWS, Inc" Then
[quoted text clipped - 25 lines]
 
A

Al Campagna

stephendeloach,
1. Please post the exact error message you received...
2. Show the exact code (cut & pasted here) you have on your report
OnFormat event
3. Is the form open when the report is run?
4. Is the CompanyFrom (see below) field located on the Main form? (not a
subform)

The error you're getting is "usually" indicative of a bad "path" to the
control value on the form that you want. If a control Name has spaces in
it, (which you should avoid) any reference to them in code, must be exactly
the same, AND... bracketed.

Here's some of your code from a previous post...
If the form name is (as you say now) "Drilling Invoice", then that code
should be...
If Forms![Drilling Invoice]!CompanyFrom = "TSWS, Inc" Then... (with
the space and bracketed)

And how about Company From.. is it "CompanyFrom" or "Company From"

--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."


stephendeloach via AccessMonster.com said:
It says it cant find form DrillingInvoice?? I have tried to replace it
with
everything. My form is named Drilling Invoice..tried that, didnt work, the
record source of the form is Table1, tried that, didnt work... any
suggestions?
thanks

Al said:
stephendeloach,
"Aircode" means that the code is not actual, but just a reference to
the
concept of what your actual code should do.
' Hide the Address fields (Visible = False)
' Show the Logo (Normally invisible... Visible = True
are two comments that describe what your code should do... not the actual
code itself.
Access cant find the form
Your form, with the CompanyFrom value should be open when you run the
report.
How is my report going to know where the Logo is?
The reason your trying to create this code is to not have 2 reports
(one
with logo and one without)
Copy and paste the logo onto report1, and make it invisible... and
your
CompanyAddress field/s visible.

Try this (use your own names, but in this code, I'll assume your fields on
the report are... CompanyAddress and CompanyLogo)

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
If Forms!DrillingInvoice!CompanyFrom = "TSWS, Inc" Then
CompanyAddress.Visible = False
CompanyLogo.Visible = True
End If
End Sub
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
If Forms!DrillingInvoice!CompanyFrom = "TSWS, Inc" Then
[quoted text clipped - 25 lines]
report
instead of the address... Can someone help me? Thanks
 

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