How do I create a macro to boldface text in Access?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Help only seems to describe how to name and save macros, but not
specifically how and where to describe the act of boldfacing.
 
Dorian,

It is difficult to imagine what circumstances you want to do this.
However, you can use a SetValue action in your macro for this purpose.
Action: SetValue
Item: [NameOfControl].[FontBold]
Expression: Yes
 
Steve --

I appreciate your response and I think it may work. But not for me. You give
the suggested codes, but I'm so new to Access I need to know how to input the
code. Step by step.

As far as the circumstances to bold face, here's how I will use it:

I'm editing dozens of Access reports and I need to boldface text in them.
I'm much faster (and efficient) at keyboard editing than point-and-click. I
would like to boldface selected text from the keyboard and not by moving my
hand to the mouse.

In many applications, for instance, boldfacing text is merely Ctrl-B.

Steve Schapel said:
Dorian,

It is difficult to imagine what circumstances you want to do this.
However, you can use a SetValue action in your macro for this purpose.
Action: SetValue
Item: [NameOfControl].[FontBold]
Expression: Yes

--
Steve Schapel, Microsoft Access MVP
Help only seems to describe how to name and save macros, but not
specifically how and where to describe the act of boldfacing.
 
Dorian,

It is not possible to edit text in a report. You can edit text in a
form. In both forma and reports, you can apply a bold face formatting -
*but*... it applies to the entire field, and affects that bolded field
for all records. Access does not support bold font for part of the data
in a field. And the only way you can get a field to be bold for one
record and not another is by the use of Condional Formatting.

(Access 2007 will support Rich Text editing, by the way.)

There are third-party rich text controls that you can add to your
application that provide this functionality. For example, see
http://www.lebans.com/richtext.htm

So, before we get to your specific question of keyboard-controlled
boldfacing, we need to clarify whether what you want to do is even feasible.
 
Steve --
Thanks again for your response. Here's a more thorough description of what
I'm doing:

In the database, there are tables, queries, forms, reports, etc. I am
working in the reports -- in Design view. In Design View each report includes
textboxes and labels which I am editing for proper prestentation. I
understand that every record will be modified by changing its Design View
text box or label.

Since I'm editing more than 70 reports, I'm looking for an efficient way to
edit the reports (in Design View). For instance, there are hotkey options for
moving the text boxes and labels (Ctrl-arrow keys). I would also like to
boldface the text boxes and labels through a hotkey. I could not find any in
the HELP menus. So, I'm pursuing a Macro solution.

I'm looking for a word-processing feature. Like MS Word's Control-B.

By the way, I will be exporting all the records into RIch Text Format files
and then bringing them into PageMaker. But I've found that it's best to
format (or edit) as much as possible before exporting to RTF.
 
Dorian,

Ok, thanks a lot for the more detailed explanation. I see that you are
using the word "edit" in a different way than I do :-).

First of all, did you know that you can format more than one control at
a time, using the toolbar buttons? For example, you could select all of
the controls on the report which you want to format as Bold, and then
one click on the Bold button and they're done.

To do what you are asking, follow these steps...

1. From the Database Window, select Macros tab, and click New.
2. If you can't see a Macro Name column in the macro design window,
select it from the View menu.
3. In the Macro Name column type this...
^b
4. In the Action column, enter..
SetValue
5. In the macro arguments towards the bottom of the screen, enter like
this...
Item: [Screen].[ActiveControl].[FotnBold]
Expression: Yes
6. Close and save the macro, name it...
AutoKeys

Now, when in design view of your report, the keyboard shortcut Ctrl+B
will format the currently selected control as Bold.
 
Back
Top