[AccessD] An Interesting question

Gustav Brock Gustav at cactus.dk
Mon Mar 30 09:48:01 CDT 2009


Hi Rocky

@ is the format when a string is present. It will present any one or more characters.
"Enter activity" is the format for Null. This is a literal string.

In some cases you may need to escape each and every character:

@;"\Y\e\a\r\s\' \t\u\r\n\o\v\e\r"

Also, you should apply the format string only when the current records is new.

For the ComboBox it doesn't work because all values listed are strings, thus a Null is turned into a zero length string.
The normal trick is to use a union query adding one row for no value:

Select Top 1
  Space(0) As Id,
  'Select Shipper' As ShipperName
>From 
  tblShipper 
Union
Select 
  Id,
  ShipperName
>From 
  tblShipper 
Order By
  Sgn(Len(Id)),
  ShipperName;

/gustav


>>> rockysmolin at bchacc.com 30-03-2009 16:20 >>>
Gustav:

That works perfectly.  Thank you. 

But, curious - why does it work?  What is the @ all about?

Is there something similar that can be done with combo boxes?  I have one
with two columns - the first one has width zero and the second non-zero.  I
tried @;"";"Enter Client" but it changes the format to @;";Select Client"
and doesn't display 
The "Enter Client".

MTIA

Rocky Smolin
Beach Access Software
858-259-4334
www.e-z-mrp.com 
www.bchacc.com 
 
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Monday, March 30, 2009 12:47 AM
To: accessd at databaseadvisors.com 
Subject: Re: [AccessD] An Interesting question

Hi Rocky

Everyone seems to forget your original question.
The elegant solution to this is to use the Format property of the TextBox
inserting the shadow text for the "format" for Null:

@;"Enter activity"

/gustav

>>> rockysmolin at bchacc.com 30-03-2009 00:37 >>>
I could but then that would put that value into the record.  He just wants a
'label' describing what should go into the field in case there no value
there.  Some of these are bound combo boxes where the bound column is the
Autonumber ID and the first column showing is some kind of descriptive data.






More information about the AccessD mailing list