473,738 Members | 3,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1968
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********@ntl world.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********@ntl world.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********@ntl world.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*********@ho tmail.com> wrote in message
news:36******** *****@individua l.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
2678
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
2822
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 typically use these to build a menu equivalent to your client-side image map if the user has disabled image loading, so you'll want to use a meaningful value here" Here's the code:
29
580
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 Access Components(MDAC) version 2.6 or later. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) at
2
24675
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 assignment of the default value. I originally used the simple statement: var v = document.getElementById('foo').value || parent.document.getElementById('foo').value || 'unknown';
0
3206
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. I've got a fairly complex (a lot more complex than originally intended) database with three main tables. The database is designed to track information about certain files. The tables are set up with one to one relationships, primarily because...
2
3831
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 activated = no) In the subform the fields are EventId, TicketNo, Qty, Section, Row, Seat,etc... I use this subform to see the list of tickets for the event and to add new tickets. When I open my form, the focus goes to the last record.
0
346
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 looking deeper into C# considering making more use of it) I created C# code from a schema with XMLspy 2005 rel 1. This code worked flawlessly. Then I moved to XMLspy 2005 rel. 3 and created C# code from exactly the same schema again - and...
6
6525
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 adoRecSet As New ADODB.Recordset ' "SELECT dbDescription,dbExternal FROM EuroPrice WHERE dbFAB = '" & Format(txtFAB.Text, "@@@ @@@ @@@@") & "'"
2
2673
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 cfinput contains required="yes". Possible?
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9334
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.