change color subform (1 Viewer)

waleedshehap

New member
Local time
Today, 02:58
Joined
Dec 16, 2017
Messages
3
hello
i need to change color subform by designing
thank you:):)
 

isladogs

MVP / VIP
Local time
Today, 10:58
Joined
Jan 14, 2017
Messages
18,216
What type of subform? Datasheet, continuous, single, split?

What do you what to change? Font colour, background colour, alternate row colour?

You need to be explain exactly what you want to do so someone can help you.
Suggest you include a screenshot of your form/subform as part of your reply.
 

waleedshehap

New member
Local time
Today, 02:58
Joined
Dec 16, 2017
Messages
3
hello
i need change subform sheet
background
thank u
 

missinglinq

AWF VIP
Local time
Today, 05:58
Joined
Jun 20, 2003
Messages
6,423
Once again...What type of subform? Datasheet, continuous, single, split?

It matters because how you do this is dependent on the Form type.

Linq ;0)>
 

isladogs

MVP / VIP
Local time
Today, 10:58
Joined
Jan 14, 2017
Messages
18,216
hello
i need change subform sheet
background
thank u

Forgot to welcome you to AWF on your first post ....

I'm guessing you mean datasheet but this will also work if its a continuous form.
Open the subform in design view, click on the detail section & view its property sheet



Click the down arrow or the ellipsis button (...) & select a colour
You can also alter the alternate row colour

You can alter the back colour of the form header & footer sections in the same way. These don't have a alternate row property

If you want to alter the background of one of more controls, select the control, view its property sheet & alter the background colour.
Make sure the Back Style property is set to Normal (Not Transparent)



Hope that helps
 

Attachments

  • Capture2.PNG
    Capture2.PNG
    4.1 KB · Views: 2,042
  • Capture1.PNG
    Capture1.PNG
    10 KB · Views: 2,684

missinglinq

AWF VIP
Local time
Today, 05:58
Joined
Jun 20, 2003
Messages
6,423
Unless something has changed since Access 2007, that won't work for a Form in Datasheet View, but you can set it in code, like this:

Code:
Private Sub Form_Load()
  Me.DatasheetBackColor = vbBlue
End Sub
or this

Code:
Private Sub Form_Load()
  Me.DatasheetBackColor = 12713921
End Sub
Linq ;0)>
 

isladogs

MVP / VIP
Local time
Today, 10:58
Joined
Jan 14, 2017
Messages
18,216
Hi Linq

Sorry - brain fade there ....

Although the property sheet lists back color & alternate back color you can't set those values by that method for datasheets (A2010)
That was of course why I asked the question about the form type in the first place. :eek:

However you CAN set BOTH values from the ribbon (A2010) as well as by using code

 

Attachments

  • Capture.PNG
    Capture.PNG
    30.9 KB · Views: 2,537

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:58
Joined
Feb 28, 2001
Messages
27,172
Waleed, there are two cases.

Ridders and missinglinq have discussed datasheets.

The other case is a "real" form (as a sub form) where a Detail section has a back-color. You can programmatically change the .BackColor property of the detail section. Remember that since you are dealing with a subform, you need to use

Me.name-of-subform-control.Form.Detail.BackColor = name-or-value-of-new-color

(or something close to that) if you are doing this from the main form's Class Module.
 

waleedshehap

New member
Local time
Today, 02:58
Joined
Dec 16, 2017
Messages
3
thank for all
I tried all the Solution , but only the code is Succeeded with me .
I work with office 2007
 

missinglinq

AWF VIP
Local time
Today, 05:58
Joined
Jun 20, 2003
Messages
6,423
Glad you got it working!

For everyone's information

...However you CAN set BOTH values from the ribbon (A2010)

that tab on the ribbon is new, with version 2010.

And as ridders said...Welcome to AWF!

Linq ;0)>
 
Last edited:

Users who are viewing this thread

Top Bottom