By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,045 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,045 IT Pros & Developers. It's quick & easy.

Mixing Formats within a textbox

P: n/a
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
Share this Question
Share on Google+
8 Replies


P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
Thanks for your reply Tom. I have never seen a "rich text" textbox
before. Where can I get it?

Jude
Nov 12 '05 #5

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.