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

Using strings that contain speech marks... 1

Status
Not open for further replies.

djayam

Technical User
Aug 16, 2005
95
GB
Hi all,

I am trying to speed up the performance of my db. One way is to define the source of controls in the OnLoad event of a form. I've hit a snag though. One of my controls is a textbox (ctl_DeliveryStatus) with the following CountrolSource:
Code:
=IIf([TotalQuantity]>[DeliveriesReceived],"DELIVERIES STILL OUTSTANDING","ALL DELIVERIES RECEIVED")
What do I type in the OnLoad event of the form as all those "" will obviously screw it up!!

Thanks loads,

Jason
 
There is nothing wrong with your ControlSource, although you'd need to ensure that the fields used have already been populated, that they aren't null, and that you're not dividing by zero.

Having sweated a lot over speed issues, I'm a bit skeptical that you'll see any improvement by 'unbinding' your form, although the form may open faster and 'appear' quicker to a user.

Max Hugen
Australia
 
Hiya Max,

It's the opening that is sped up and it's pretty noticeable.

In the OnLoad if I type
Code:
ctl_DeliveryStatus.ControlSource = "IIf([TotalQuantity]>[DeliveriesReceived],"DELIVERIES STILL OUTSTANDING","ALL DELIVERIES RECEIVED")"
it will error due to the "" screwing up the string. So how can I put " in a ControlSource?

Thanks,

Jason
 
Code:
ctl_DeliveryStatus.ControlSource = "IIf([TotalQuantity]>[DeliveriesReceived],""DELIVERIES STILL OUTSTANDING"",""ALL DELIVERIES RECEIVED"")"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Simple as that eh? Thanks PHV - I'll give it a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top