Sign in to follow this  
SKATIN_HARD

more VB help please.......

Recommended Posts

SKATIN_HARD    175
Now I have this code: (to change the color of text) Private Sub Command1_Click() (HIGHLIGHTED HERE) If Option1.Value = True Then Form1.Text1.ForeColor = vbRed If Option2.Value = True Then Form1.Text1.ForeColor = vbBlue If Option3.Value = True Then Form1.Text1.ForeColor = vbBlack If Option4.Value = True Then Form1.Text1.ForeColor = vbGreen If Option5.Value = True Then Form1.Text1.Appearance = 1 If Option6.Value = True Then Form1.Text1.Appearance = 0 If Check1.Value = 1 Then Form1.Text1.FontBold = True Else Form1.Text1.FontBold = False End If If Check2.Value = 1 Then Form1.Text1.Font.Italic = True Else Form1.Text1.Font.Italic = False End If Form2.Hide End Sub The first line for the Command click button is hightlighted. The error is method or data member not found. Can somebody help again?? thanks

Share this post


Link to post
Share on other sites
Dim_Yimma_H    557
I didn't get any error so there's no problem with the code. Make sure though all the referenced Controls exist and that they have the name you've specified in your code.

Oh I changed an Else-statement that didn't have an If but it was probably just messed up when pasting into the post I suppose.


Private Sub Command1_Click()
If Option1.Value = True Then Form1.Text1.ForeColor = vbRed
If Option2.Value = True Then Form1.Text1.ForeColor = vbBlue
If Option3.Value = True Then Form1.Text1.ForeColor = vbBlack
If Option4.Value = True Then Form1.Text1.ForeColor = vbGreen

If Option5.Value = True Then Form1.Text1.Appearance = 1
If Option6.Value = True Then Form1.Text1.Appearance = 0

If Check1.Value = 1 Then
Form1.Text1.FontBold = True
Else
Form1.Text1.FontBold = False
End If

If Check2.Value = 1 Then
Form1.Text1.Font.Italic = True
Else
Form1.Text1.Font.Italic = False
End If

Form2.Hide

End Sub



\Jimmy H

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this