473,698 Members | 2,602 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 1965
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
2676
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
2817
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
24667
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
3200
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
3829
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
6523
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
2672
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
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9030
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...
1
8899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7738
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...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
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
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
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.