473,394 Members | 1,778 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,394 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 1951
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.