471,309 Members | 1,192 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,309 software developers and data experts.

Format to say "Required"

Ian
Using Access 97 I have a form with several text boxes, I am trying to get
each text box to display the word "Required" for the appropriate boxes on a
new record. A friend gave me the following line of code that I put into the
text box Format property:

@;"Required"[Red]

This works perfectly, problem is that this text box's Format also has to be
set as Short Date, I don't seem to be able to combine the two so its
formatted as a short date and reads "Required" on a new record, any help
would be appreciated.

Regards
Nov 13 '05 #1
7 1800
Try leaving the Format as you have it and setting the Input Mask (Data tab)
to:

99/99/0000;0;_

--
Wayne Morgan
MS Access MVP
"Ian" <ia********@ntlworld.com> wrote in message
news:SG**************@newsfe2-win.ntli.net...
Using Access 97 I have a form with several text boxes, I am trying to get
each text box to display the word "Required" for the appropriate boxes on
a
new record. A friend gave me the following line of code that I put into
the
text box Format property:

@;"Required"[Red]

This works perfectly, problem is that this text box's Format also has to
be
set as Short Date, I don't seem to be able to combine the two so its
formatted as a short date and reads "Required" on a new record, any help
would be appreciated.

Regards

Nov 13 '05 #2
PS.

When you first set the Input Mask, Access will change the Format to Short
Date. Just change it back to what you have.

--
Wayne Morgan
MS Access MVP
Nov 13 '05 #3
Ian
I tried setting the Input Mask to: 99/99/0000;0;_ and leaving the Format as:
@;"Required"[Red]. My date set to 02/10/04 now shows 38262.
Nov 13 '05 #4
I just tried it again here and got the same thing. I had done a quick test
with an unbound textbox and it had worked with that.

So basically, the answer is No, but there is a work around.

1) Place another textbox exactly over the current textbox. Delete the label
for this new textbox.

2) For this new textbox, set Enabled to No, Locked to Yes, Control Source to
="Required", ForeColor to Red (use the color picker).

3) In the AfterUpdate event of the current textbox and in the Current event
of the form, hide/unhide this new textbox as needed.

4) When the new textbox is visible, since it can't receive the focus, when
you tab or click into it, it'll actually go to the background and the
current textbox will show through. This will let you make your entry.

This will "look" like what you're asking for.

--
Wayne Morgan
MS Access MVP
"Ian" <ia********@ntlworld.com> wrote in message
news:Dh**************@newsfe1-gui.ntli.net...
I tried setting the Input Mask to: 99/99/0000;0;_ and leaving the Format
as:
@;"Required"[Red]. My date set to 02/10/04 now shows 38262.

Nov 13 '05 #5
Wayne Morgan wrote:
I just tried it again here and got the same thing. I had done a quick
test with an unbound textbox and it had worked with that.

So basically, the answer is No, but there is a work around.

1) Place another textbox exactly over the current textbox. Delete the
label for this new textbox.

2) For this new textbox, set Enabled to No, Locked to Yes, Control
Source to ="Required", ForeColor to Red (use the color picker).

3) In the AfterUpdate event of the current textbox and in the Current
event of the form, hide/unhide this new textbox as needed.

4) When the new textbox is visible, since it can't receive the focus,
when you tab or click into it, it'll actually go to the background
and the current textbox will show through. This will let you make
your entry.
This will "look" like what you're asking for.


Instead of hiding/showing I would suggest a ControlSource of...

=IIf(IsNull([RealControl]), "Required","")
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #6
On Wed, 02 Feb 2005 01:04:50 GMT, "Ian" <ia********@ntlworld.com>
wrote:

Keep it simple, and use a technique that Access more readily supports,
such as:
* Use a subtle background color.
* Use an * after the label, as many websites do.

-Tom.
Using Access 97 I have a form with several text boxes, I am trying to get
each text box to display the word "Required" for the appropriate boxes on a
new record. A friend gave me the following line of code that I put into the
text box Format property:

@;"Required"[Red]

This works perfectly, problem is that this text box's Format also has to be
set as Short Date, I don't seem to be able to combine the two so its
formatted as a short date and reads "Required" on a new record, any help
would be appreciated.

Regards


Nov 13 '05 #7
Nice touch Rick, thanks.

--
Wayne Morgan
MS Access MVP
"Rick Brandt" <ri*********@hotmail.com> wrote in message
news:36*************@individual.net...

Instead of hiding/showing I would suggest a ControlSource of...

=IIf(IsNull([RealControl]), "Required","")

Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Nimmi Srivastav | last post: by
14 posts views Thread by Torbjørn Pettersen | last post: by
29 posts views Thread by DraguVaso | last post: by
2 posts views Thread by Dave Hammond | last post: by
2 posts views Thread by chacquard | last post: by
reply views Thread by Michael Steidl | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.