Link to home
Start Free TrialLog in
Avatar of CraigLazar
CraigLazar

asked on

Problems with form back color

Hi
i am trying to change the backcolor of my form from blue 2 white.
it is not changing
this is the code i am trying to use. I am able to change my labels and text boxes with the same method except fpr the form backcolor

batches.backcolor = &h0&

Thanx
Craig

ASKER CERTIFIED SOLUTION
Avatar of wsh2
wsh2

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 caraf_g
caraf_g

OK, apart from the fact that you've specified black as the backcolour rather than white I don't see a major mistake - the colour should still have changed.

Perhaps you're working with an instance of the form, and an object variable, and in this case you accidentally used the form name?

e.g.

Dim frmX As frmMain
Set frmX = New frmMain

frmX.SomeButton.BackColor = vbWhite

frmMain.BackColor = vbWhite '<-wrong,
frmX.BackColor = vbWhite '<-correct

?
Very good Caraf G.. I forgot all about the VB color constants.. thank you for the reminder.. <smile>
Craig, I don't understand how wsh2's suggestion solved your problem?

In your question you state that you do:
batches.backcolor = &h0&

But, when you try that
"it is not changing"

That doesn't make sense. The form should have changed, except it should have gone black instead of white.

So from the premise that you gave us correct information in your question it logically follows that wsh2's answer cannot be the correct answer to solve your problem.
Avatar of CraigLazar

ASKER

Hi cara_g
i am very sorry
i meant to ask u to post the answer but i was in a rush and only realised after i acepted the answer.
So i am gonna post another question for u only to answer and i will grade it. Sorry mate i am embarrased and sorry if i hacked u off.

thanx for the great help

Craig
Not at all, Craig, I didn't mean to come across like that. I was genuinely confused as I couldn't work it out.

Thanks

Pino