473,387 Members | 1,536 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,387 software developers and data experts.

Mixing Formats within a textbox

Hi all,
I'm trying to mix bold and non-bold text within a textbox on a report.
Has anyone out there ever figured out how? Thanks!

Jude
Nov 12 '05 #1
8 4302
"TC" (27 October 2003) wrote
Say the user types the potentially duplicated value into a textbox.

Use a DLookup() function in the BeforeUpdate event of that textbox....


I tried this (DLookup seems to work on either Tables or Query domains only)
but I could not get it to work. What do I need to do? I am checking an
item (item_code) in a table (tblItem) and want to add it ONLY if it is new.
My code (aircode as I'm not at work!!) was something like:

dim varTxt as Variant
varTxt=DLookup("[item_code]","tblItem")
if varTXT ="" Then
msgbox "Item already stored"
cancel=True
end if

in the BeforeUpdate event - of course!

It didn't work! I checked (via msgbox varTxt) what was 'found' and it
showed the last item on the list (which keeps changing, obviously, as I add
more items!)

What am I doing wrong? Can anyone help as I'd like to validate this BEFORE
the user adds all of the other fields - the database then tells them that
the item already exists, much too late as they have typed all the data by
then, to no avail.

Hope you can understand this and - here's hoping you can help me!

Thanks in advance

Nick
Nov 12 '05 #2
On 28 Oct 2003 12:35:12 -0800, he***********@yahoo.com (Jude) wrote:

A regular text box can't do that. Try a rich text box, or perhaps an
HTML control.

-Tom.

Hi all,
I'm trying to mix bold and non-bold text within a textbox on a report.
Has anyone out there ever figured out how? Thanks!

Jude


Nov 12 '05 #3
Since you can only modfy the format for the entire textbox control my
solution was multiple textboxes - whenever you need to put something
in bold, break it out into it;s own textbox. In this way I did a
mailmerge letter for mass mailing.

John

he***********@yahoo.com (Jude) wrote in message news:<ac**************************@posting.google. com>...
Hi all,
I'm trying to mix bold and non-bold text within a textbox on a report.
Has anyone out there ever figured out how? Thanks!

Jude

Nov 12 '05 #4
Thanks for your reply Tom. I have never seen a "rich text" textbox
before. Where can I get it?

Jude
Nov 12 '05 #5
"Jude" wrote
Thanks for your reply Tom. I have never
seen a "rich text" textbox before. Where
can I get it?


Something similar is available on MVP Stephen Lebans' site,
http://www.lebans.com.

But if something in your nature just compels you to pay for such a Control,
one is included with the Office <version> Developer Edition and a
third-party rich text control is available from FMS, Inc.,
http://www.fmsinc.com.

Larry Linson
Microsoft Access MVP
Nov 12 '05 #6
You need a criteria argument.

varTxt=DLookup("[item_code]","tblItem","item_code='something'")
(I used single quotes for 'something' assuming text, drop if not)

Also, Dlookup will return null if not found so something like ...

If Not IsNull(varTXT) Then
msgbox "Item already stored"
cancel=True

- Jim

On Tue, 28 Oct 2003 21:21:52 -0000, "Nick Marshall" <Nick
Ma******@NOSPAM.COM> wrote:

dim varTxt as Variant
varTxt=DLookup("[item_code]","tblItem")
if varTXT ="" Then
msgbox "Item already stored"
cancel=True
end if

in the BeforeUpdate event - of course!

It didn't work! I checked (via msgbox varTxt) what was 'found' and it
showed the last item on the list (which keeps changing, obviously, as I add
more items!)

What am I doing wrong? Can anyone help as I'd like to validate this BEFORE
the user adds all of the other fields - the database then tells them that
the item already exists, much too late as they have typed all the data by
then, to no avail.

Hope you can understand this and - here's hoping you can help me!

Thanks in advance

Nick


Nov 12 '05 #7
I appreciate your feedback Larry. Since there weren't any fields
embedded in the text, I decided to use a Word document object. It
ended up being the easiest way to solve the problem. I shy away from
3rd-party controls usually because you never know if they'll be
upgradable, etc.
Jude

"Larry Linson" <bo*****@localhost.not> wrote in message news:<Av****************@nwrddc02.gnilink.net>...
"Jude" wrote
> Thanks for your reply Tom. I have never
> seen a "rich text" textbox before. Where
> can I get it?


Something similar is available on MVP Stephen Lebans' site,
http://www.lebans.com.

But if something in your nature just compels you to pay for such a Control,
one is included with the Office <version> Developer Edition and a
third-party rich text control is available from FMS, Inc.,
http://www.fmsinc.com.

Larry Linson
Microsoft Access MVP

Nov 12 '05 #8
By the way John, thanks for your reply. Your method is the way my
report was being done already. The problem comes in when you try to
print the report on different printers. The text may be interpreted
differently and the textboxes not line up properly.
Jude

jo*******@excite.com (John) wrote in message news:<c4*************************@posting.google.c om>...
Since you can only modfy the format for the entire textbox control my
solution was multiple textboxes - whenever you need to put something
in bold, break it out into it;s own textbox. In this way I did a
mailmerge letter for mass mailing.

John

he***********@yahoo.com (Jude) wrote in message news:<ac**************************@posting.google. com>...
Hi all,
I'm trying to mix bold and non-bold text within a textbox on a report.
Has anyone out there ever figured out how? Thanks!

Jude

Nov 12 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Erik Max Francis | last post by:
Is there any prohibition against mixing different protocols within the same pickle? I don't see anything about this in the Python Library Reference and, after all, the pickle.dump function takes a...
1
by: Marc Cromme | last post by:
I would like to ask a question about (good ?) style and possibilities in mixing C FILE* and C++ file streams. The background is that I want to use the C libpng library from within C++, but I...
3
by: Tim | last post by:
Hi I have a program that I had written in Managed C++ that writes messages to the console while running. I wanted to allow the user to enter commands at the console as well, but this became...
14
by: MLH | last post by:
I use A97. I've gotten used to reading values from textbox controls on forms, I've come to rely on it pretty heavily. My habit spills over into reports. I'm uncertain whether I can reliably read...
2
by: Adam Honek | last post by:
I have a form. It has serveral text boxes for user data entry. I could of course write code to check if each is empty before proceeding to save this data to a file. Is there any global way...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
4
by: mdarling | last post by:
I am using Lebans lady example to mix Bold and Normal in a single line text box, I have altered it and I still cant get it to bold the text I need bolded I have pasted it here, can somebody help? I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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,...
0
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,...
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...

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.