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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If or then problem

Status
Not open for further replies.

RobPotts

Technical User
Aug 5, 2002
232
US
Hi,

I'm not that great at code but I'm stumped with this and have no idea whats wrong.

I Have a report which on the on open command I've got the following code

If Me.EstablishmentSelect = "Other" Or Not IsNull(Me.EstablishmentSelect) Then
Me.EstablishmentSelect.Visible = False
Me.EstablishmentOther.Visible = True
End If

The report is based on a query called QryCompany. The EstablishmentSelect field on the report is visible and the EstablishmentOther is not visible. I have no problems with the isnull part by itsself, but when I try to run the ="Other" by iself or as above I get the following error Runtime error 2427, you entered an expression that has no value. Can someone please put me right.

Thanks in advance

Rob! [Bigcheeks]
Process and Procedure are the last hiding place of people without the wit
and wisdom to do their job properly.
 
Do you have a control named EstablishmentOther on your form?

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
try putting the if statement in the Report_Activate section. the way i understand Report_Activate is thatit lets the fields populate with data the it runs the code.
 
Which kind of control is EstablishmentSelect ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi I tried putting it in the on Activate, and it works, kinda. It seems to look at the first record on the report and this dictates for all records, is there a way to do this for each record on the report



Rob! [Bigcheeks]
Process and Procedure are the last hiding place of people without the wit
and wisdom to do their job properly.
 
try putting it if statement in the Detail_Format
 
Take a look at OnFormat

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Try the OnFormat event which gets triggered just before each record is formatted.
 
I had a brainwave and crreated a field in the underlying query which does the job well

Thanks all anyway


Rob! [Bigcheeks]
Process and Procedure are the last hiding place of people without the wit
and wisdom to do their job properly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top