Access formatting question

I have a form with a field that requires a font for dimensional/inspection symbols called cybermetricsgdt.  The field does not use cybermetrics every record.  When you just write normal into the field it always looks odd.  Is there a way to put some code for that field to use arial except for when inspection symbols are required (cybermetrics)?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeOwner, Developing Solutions LLCCommented:
You could add a field to the underlying table, maybe a Yes/No field (displayed as a checkbox) on the form.

Then you would need to add code to two events to change the font.  The first event would be the Click event of the checkbox

Private Sub chk_Cybermetrics_Click

    if me.chk_CyberMetrics = true then
        me.txt_cybermetricsgdt.Font = "X"
        me.txt_Cybermetricsgdt.FontName = "Arial"
    End If

End Sub

Then, you also need to put code in the Forms Current event, so as you move from one record to the next it will automatically reset the fontname property.  You can do this with a single line

Private Sub Form_Current

    Call chk_cybermetrics_Click

End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeffrey CoachmanMIS LiasonCommented:
Then why not use two fields?

I'm confused as to why one field would be called upon to "present" to distinct fonts (based on writing "Normal" in that field.)

The field does not use cybermetrics every record.
Then if it's not cybermetrics , then why not leave it empty? (and type the non cybermetrics data into another field?)
To me, this analogous to wanting to have two different datatypes in one field (for example, text and number) and trying to format text values differently from the numbers.

Can you give us some background on this field/data (with a specific example) that will explain to us why it must be this way?
For example, how, exactly do you enter cybermetrics in this field (as opposed to "normal" input)


jpb12345Author Commented:
First of all its for a discrepant part report.  The field is what a dimension or part Should be based off a print etc.  Cybermetrics gdt is a dimensional tolerance font.  So you can put the symbol for a diameter or true position, etc.  There are times where it may be a visual discrepancy where the inspector might say Part has workmanship problems, dings, porosity, etc.  That's when it will be nice to be able to change the font.  Cybermetricsgdt is just a program that you download onto to your computer and it becomes one of the fonts you can use in microsoft programs.
Jeffrey CoachmanMIS LiasonCommented:
I am still not clear on why it cant be two fields, and avoid vba code.
So perhaps I am misunderstanding something...

So Dale's solution looks like the way to go.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.