TinleyParkILGal said:
Please help. I have a form with a textbox which is an autonumber in
the underlying table. I do not want the box to be visible until the
autonumber is in the record when the user begins to enter a record.
Thanks in advance.
I gather from your dialog with Sprinks that this is on a continuous
form. There is no direct way to support this, but you can make it
happen by covering the control with another that will hide it under the
circumstances you describe. Create another text box that is slightly
bigger in all dimensions than the original text box, and position it on
top of that control so that it completely covers it up. Then set that
text box's properties as follows:
Back Style: Transparent
Special Effect: Flat
Border Style: Transparent
Fore Color: (the same as that of the form's detail section)
Font Name: Terminal (or other font -- see below)
Font Size: (big enough to completely fill the text box)
Enabled: No
Locked: Yes
Control Source: =IIf(IsNull([YourAutonumber]), String(100,"Û"),
Null)
The "Û" character is the Chr(219), the character that in the Terminal
font totally fills the space with a block character. This, in
conjunction with the IIf() expression, will cover up the original text
box whenever the autonumber field has a Null value.
I suggested the Terminal font above because you can count on its being
present on all Windows systems and it has large block characters that do
the job on most systems. However, I am told that it doesn't give
satsfactory results on all PCs. You may want to choose a user-created
font that you can count on, and distribute it with your application.
See this link:
http://www.mvps.org/access/forms/frm0055.htm
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)