Emergent help needed on report printing

S

su chen

Can anybody tell me what's wrong with this code? It keeps
telling me" compile error, method or data member not found?

this is emergent! please help! FYI, I am using access
2000!

Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)

If Not IsNull(Me!Benzene) Then
If Val(Me!Benzene) >= 0.55 Then
Me.Benzene.FontUnderline = True
Else
Me.Benzene.FontUnderline = False
End If
End If

End Sub
 
P

Petrucci2000

Hi,

My name is Eric. Thank you for using the Microsoft Access Newsgroups.

You wrote:
"..It keeps telling me" compile error, method or data member not found?"

Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)

If Not IsNull(Me!Benzene) Then
If Val(Me!Benzene) >= 0.55 Then
Me.Benzene.FontUnderline = True
Else
Me.Benzene.FontUnderline = False
End If
End If

End Sub

SOLUTION:
The only way I'm able to reproduce the error is change the name of my
control "Benzene" to something else like "BenzeneX"

Check the name of your control in your Report that's supposed to be
"Benzene"

Note: Look at the Name property of the textbox control

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."
 
G

Guest

Thnaks for you reply, I checked the name and
its "Benzene", FYI, when the warning pop up,
the"FontUnderline" was highlighted!

Have any ideas?
 
G

Guest

It seems like Me.Benzene. can only followed by "Value",
However, Me. can be followed by FontUnderline!

Anything wrong with my access?
 
P

Petrucci2000

- Create a brand new database
- Create a blank unbound Report (not bound to a table)
- Create a textbox control on the Report that has for it's Control Source
="Test"
- Name the Textbox control "Text0"
- Click menu option View > Code then copy and paste the following code

Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)

If Not IsNull(Me!Text0) Then
If Val(Me!Text0) >= 0.55 Then
Me.Text0.FontUnderline = True
Else
Me.Text0.FontUnderline = False
End If
End If

End Sub


- Open the Report in Print Preview

If the Report succeeds (no error) then it's possible that you have
something wrong with the VBA module in your Report. If it also fails I
would test the same database application on another computer. If it
succeeds on the other computer then Yes...you have a problem with your
install (particulary VBE6.dll).

If it's just your Report's module then I would do the following:
- Copy the entire code behind the Report and paste into a notepad file
- Look at the Report's properties (the Other tab) and for the property "Has
Module" change it from "Yes" to "No" to delete all the code behind the
Report
- Close and save your changes to the Report
- Press ALT + F11 to switch to the VBE window
- Select the menu option View > Immediate Window
- In the immediate window type the following and hit enter
Application.SaveAsText acReport, "name of your report",
"c:\MyReport.txt"

- In the immediate window type the following and hit enter
Application.SaveAsText acReport, "newReport",
"c:\MyReport.txt"

- Switch back to your database window and open the new report in design
view "newReport"

- Select the menu option View > Code

- In the VBE window select the menu option View > Select ALL

- Copy and paste the code copied to the notepad file into the VBE window

- Close and save the report

- Rename the Report to the original name of your Report (replacing your old
Report) and test

I hope this helps.

Eric
 

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