borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (IE8 automation error)Next Topic (=excelfunction in loop) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Access Help With Visual Basic Solved Topic
Poster Message
Sofa_King
Level: Trainee

Registered: 18-10-2009
Posts: 2

Ads by Lake Quincy Media
icon Access Help With Visual Basic

I'm new to visual basic and am in need of help. In Microsoft Access I need to create a procedure with visual basic to display the LessonType field value in bold, blue text when the value is "Voice" and in normal, black text for all other values. I don't have any idea how to do this, could someone help me out please?

Ads by Lake Quincy Media
18-10-2009 at 06:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
Sofa_King
Level: Trainee

Registered: 18-10-2009
Posts: 2
icon Re: Access Help With Visual Basic

I figured it out, I had to write the code in the "On Current" property and this is the code that I used just in case anyone else ever has the same problem.

Option Compare Database


Private Sub Form_Current()
    'Display the LessonType field value in bold,
    'blue text when the value is "Voice"
    If [LessonType] = "Voice" Then
            [LessonType] = "Voice"
            [LessonType].FontBold = True
            [LessonType].ForeColor = RGB(0, 0, 255)
            Else
            [LessonType].FontBold = False
            [LessonType].ForeColor = RGB(0, 0, 0)
    End If
End Sub


[Edited by Sofa_King on 18-10-2009 at 10:09 PM GMT]

18-10-2009 at 09:23 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Access Help With Visual Basic Solved Topic
Previous Topic (IE8 automation error)Next Topic (=excelfunction in loop) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder