Link to home
Start Free TrialLog in
Avatar of mytfein
mytfein

asked on

datasheet - question 8 - can the column heading be made BOLD?

Hi EE,

I made the column's lable BOLD, by clicking B, - it's bold in design view
             yet NOT bold                                                        in datasheet view.

Is there a way to do this via VBA?
tx, sandra
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image



Me.DatasheetFontWeight = 700

mx
ASKER CERTIFIED SOLUTION
Avatar of TextReport
TextReport
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes ... sorry, forgot to mention that ... and a good idea about using CF.

mx
Avatar of mytfein
mytfein

ASKER

Hi Andrew,
a) Recently DBmx offered this web link for alternate coloring of rows
    https://www.experts-exchange.com/questions/24265237/datasheets-question-3.html

b) have not had a chance to look at (a), primarily bec. I'm not well versed in custom classes in OOP
c) yes, i'd like only column headers to be bold
     i do not know how to code your suggestion
          i only know how to do conditional formatiing
          via menu/formatting/conditional for these situations:
               1) if field got focus - set back color to yellow
               2) if field = "somevalue" set back color (to differentiate rows on continuous rows form)

can you offer more guidance, pls?
tx, s
     
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mytfein

ASKER

hi mx,

oic, that explains why you chose 700

yet i wish to apply bold only to column headings, not to *entire* datasheet

tx, s
Actually, I'm not seeing the labels bold, are you ?

mx
Avatar of mytfein

ASKER

hi mx,

a) I put in your suggestion:
   Me.DatasheetFontWeight = 700
the datasheet is bold, yet i just want the headers to be bold for contrast....

b) do you agree that if you change a datasheet property, that change becomes the default bec.
    now i have to code:
            Me.DatasheetFontWeight = 400
       to set font back to normal weight..... tx, s
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mytfein

ASKER

hi mx,

tx for all your help, today,

i'll pick this up again tommorrow..... have a good evening....

tx, s
Hi Sarah and mx, Ive been away for 5 minutes (ok a couple of hours) and all these posts. MX you are correct in what I was trying to suggest but this still leave it that ALL headings will be bold.

Sarah with regards to setting he alternative lines shouldn't be an issue as you just need to set the fontweight in the conditional formating for all conditions you specify.

Cheers, Andrew
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mytfein

ASKER

Good morning Andrew,
Tried your suggestion this morning, just for one cell(column): In the following manner:

My datasheet columns are locked except for the column: cboRejectReason.
The datasheet back color is set to an olive green.
I want the color of the cboRejectReason column to be white, so the user know that is a key-able control.

So using your suggestion, (while that was not the original purpose of this post - this post related
to datasheet headings) did the following:

clicked on: cboRejectReason
                        Format/Conditional Formatting
                                changed to Expression Is     tabbed over and typed:  True
                                         set back color to white, and text to BOLD

It worked!  thx sooo much,  Any ideas about column headings, though :), tx, s
sandra ... are you column headings Bold ?

mx
Avatar of mytfein

ASKER

Hi mx,

a) no, column headings are not bold

b) (This morning, I posted on a yahoogroup  (ms_access_professionals2yahoogroups.com
and got this response from an Access author.

Sandra-

No, you can't modify the column headings separately. In Datasheet view of a
form, you can change the font or bold or underline, but that affects the
entire view. If you want the "look" of a datasheet with bold headings,
design a Continuous Form with the column labels lined up across the form
header and the controls for the data lined up right underneath. When you do
that, you can modify each control individually. The downside is you lose
the ability to resize the columns when in form view, but that could be a
good thing. In a datasheet, a user can accidentally hide a column by
shrinking it to zero width

John Viescas, author
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas. com/
(Paris, France)

c) mx, on another post you uploaded a screenp.shot to EE to prove a point as a .GIF.
i was inspired, and pasted the screenshot into PAINT and saved it as bmp

Did you do that same process to upload your screen shot?
tx, s
a-datasheet-screenshot.bmp
a)  I cannot seem to make the col heading bold with the  Me.DatasheetFontWeight = 700 command ... which I *thought* in the past it did ... as well as the cells!!  So, I'm confused.

b)  John V probably knows what he is talking about :-)

c) I use Robo Screen Capture ... available from Adobe - which bought the original company.

mx
Avatar of mytfein

ASKER

Thx guys for your help....

Dear Public:
    It seems that datasheet headings CANNOT  be modified
    Since Andrew and DBmx offered ideas as to how to modify datasheet cells, that is useful to,
       and I did get it to work, so that's where the points are going to.

tx, s
I *know* I seen the headings go bold ... at the same time the cells do ... with that one line of code.  But for some reason, I cannot reproduce that right now.  I will post back if I do.

thx.mx
Hi the code below is rand from a command button on the main form to change the fontweight of the sub form in datasheet view. The datasheet has conditional formatting on so the records do not get affected but the headings do.

Cheers, Andrew
    If Me.frmSub.Form.DatasheetFontWeight <> 700 Then
       Me.frmSub.Form.DatasheetFontWeight = 700
    Else
       Me.frmSub.Form.DatasheetFontWeight = 400
    End If

Open in new window

Avatar of mytfein

ASKER

Andrew,
thx for writing...

a) i understand that in the code above you are using the command button as a "toggle" switch.
b) i do not understand what you want me to do for conditional formatting. can you please explain
     or post a screen shot. thx...

c) Truthfully, I do not understand your previous suggestion that works of:
    Formatting/Conditional Formatting:
               Expression    is True

      does Expression is True - mean that the cell has data?

tx, sandra
Hi Sandra, the conditional format for every control is set as below, the Expression True means that all values for each control will use this Conditional Format and therefore set the font to NOT BOLD. Hope this demonstrates what you are after.
Cheers, Andrew
ConditionalFormat.jpg
Form-Normal.jpg
Form-Bold.jpg
Avatar of mytfein

ASKER

Also, Andrew:
    would like to  confirm what mx said: that headings are not bold by the following statement:
     here is a screen shot, of data bolded, but not the headers

With subStudentDetail.Form
        .DatasheetFontWeight = 700
end with
a-datasheet-screenshot-allbold.bmp
As you can see from my screen shots setting the DatasheetFontWeight affects the column headings, this is in Access 2007.
Can you confirm that the DataSheetFontWeight has been set to 700 and also what the conditional formating is for the controls.
Cheers, Andrew
Avatar of mytfein

ASKER

Andrew,
Thx sooo much for taking the time to upload screenshots.

I understand your explanation.
    I changed all controls instead of the checbox control to:
              Expression Is true

I use A2003 - headings still not bold....
Maybe only A2007 can do this....

I have to leave shortly... if  you like, can i post the mdb on Sun/Mon for you to test on  A2007 ?
tx for your help on this issue, sandra

tx, s
090424-confform.bmp
sandra ... just an fyi ... try to up load JPG's or GIF's .... which are much smaller and faster than BMP ...

thx.mx
Avatar of mytfein

ASKER

hi mx,

oic... will know for next time... tx... have a nice weekend everyone, sandra
Hi Sandra, "I use A2003 - headings still not bold.... Maybe only A2007 can do this...." I did look at setting this in Access 2002 but I had problems so I didn't persue it, I suspect it is a 2007 thing. Interesting to note though changing the DatasheetForeColor doesn't change the headings / titles in 2007.

Yes I can test your example in Access 2007 for you.

Cheers, Andrew
Avatar of mytfein

ASKER

Andrew,
thx sooooooo much for helping me with this.....

i will send you on Monday the mdb, thx, bec. have to leave for weekend now...

be well, s
Avatar of mytfein

ASKER

Hi Andrew,
Some time ago you kindly offered to test my mdb in Access 2007 for the datasheet's font's headings.
Although, I have A2003 at work, this mdb is 2000 version, bec. at home I have A2000.
 
I was waiting to give you a neater version, it still needs more work....
   (also, this is my first exposure to tree control, so a friend did most of the coding)

If this takes longer than 10 minutes, then I do not want you to spend time on it....
tx very much, sandra
db1.mdb