Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The Access 2000 database that I'm w

Status
Not open for further replies.

Mike555

Technical User
Joined
Feb 21, 2003
Messages
1,200
Location
US
The Access 2000 database that I'm working on prints customer invoices. I'm trying to setup a report so that if the ClientID field in the Client table reads "ABC", then a dialog box will display on the report reading "unique payment plan (see notes)". If the ClientID field equals anything other than "ABC", then this dialog box should say "Charge Account". Below is the syntax that I have, but it does not work.


If Tables!Client.ClientID = "ABC" Then
Me.txtbox.FontWeight = 700
Me.txtbox.ForeColor = RGB(255, 0, 0)
Me.txtbox.Caption = "Unique Payment Plan (see notes)"
Else
Me.txtbox.FontWeight = 700
Me.txtbox.ForeColor = RGB(255, 0, 0)
Me.txtbox.Caption = "Charge Account"

End If


Appreciate any help.

Mike
 
Mike

I am not sure what your "Me.txtbox" is referring to but try the code below.

In the field where you want the comment to appear, place two text boxes (in my case, address3 and text19). Make them both invisible. Set the control source for the first text box to "Unique Payment Plan (see notes)" and the control source for the second text box to "Charge Account".
Then in the detail_format section of your report, type the following code.
If Tables!Client.ClientID = "ABC" Then
address3.FontWeight = 700
address3.ForeColor = RGB(255, 0, 0)
Text19.Visible = True ' display Charge Account Comment
address3.Visible = False ' hide Payment Plan Comment
Else
address3.FontWeight = 700
address3.ForeColor = RGB(255, 0, 0)
Text19.Visible = False 'hide Charge Account Comment
address3.Visible = True 'display payment plan comment
End If

This should give you the results that you are after

HTH

Elise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top