473,220 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,220 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 1941
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nimmi Srivastav | last post by:
When I was learning C, I learned that the data type of a function name by itself is a function pointer. For example int someFunction(char* str) { .... }
14
by: Torbjørn Pettersen | last post by:
I get the following error: "You left off a required attribute of the indicated element. The most common such omitted attribute is the ALT attribute of the AREA or IMG element; browsers will...
29
by: DraguVaso | last post by:
Hi, I'm having this error in a VB.NET-application at the moment that I attempt to read data from an SQL Server: The .Net Data SQL Provider (System.Data.SqlClient) requires Microsoft Data...
2
by: Dave Hammond | last post by:
I've got what should be a simple assignment of either an element value or a default string to a variable, but when the element doesn't exist I get an "Object required" error rather than an...
0
by: elvin | last post by:
Okay - apologize in advance for the length, but I want to make sure all you knowledgeable and helpful people have all the details you need to hopefully point my newbie rear in the right direction....
2
by: chacquard | last post by:
Hi, I've been working on a form that contains a subform. The fields in the main form are EvendId, EventName, Date, time, place, etc.. These fields cannot be edited (locked = yes and...
0
by: Michael Steidl | last post by:
I use XMLspy for handling XML files and started testing its feature to generate C# code from XML Schemas. Now I got stuck in a strange situation: (I have to add being not a C# geek, only currently...
6
by: BlackMustard | last post by:
hi all, i get a run-time error '424': Object Required on the last line below, and i can't figure out why... Dim adoConn As New ADODB.Connection Dim adoCmd As New ADODB.Command Dim...
2
by: Alexei Lebedev | last post by:
Hi all. As you know Coldfusion dynamically generates js code for cfinput tags. And there is required="yes" feature. I want to automatically add red asterisk at the end of input field when...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.