Solved

Conditional formatting in Access: Adding symbol to field

Posted on 2012-04-03
5
341 Views
Last Modified: 2012-08-13
Hello!

I have an access form with, for the purpose of this question, has two fields:

"Action" and "Action Type"

"Action" is a text field. It is just the name of any action.

"Action Type" is a number field. It defines an action as being a task or a meeting. 1 for task, 2 for meeting.


When the "Action Type" is 2, I want whatever is in the "Action" field preceded by a *.

Example: Worked on this database till my eyes popped out. (Action Type 1)
                *Meeting about how I cry too much when working on databases (Action Type 2)


How should I do this? And ideas?

Thank you!
0
Comment
Question by:Megin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 37804133
I would suggest not storing the * with your data.

Instead, create a label next to the Action field that just displays a "*"

then in the Current Event of your form:

Me.lblAsterisk.Visible = (Me.[Action Type] = 2)
0
 

Author Comment

by:Megin
ID: 37814608
I am afraid this isn't working for me. For some reason, either all of the tasks have an asterisk or none of them do.

Any more ideas?
0
 

Accepted Solution

by:
Megin earned 0 total points
ID: 37816640
I solved this by adding a special query field:
                           strAction: Iif([actType]=2,"*" & [ActName],[ActName])


Thank you to those who took the time to try and help! This site is fantastic!
0
 
LVL 61

Expert Comment

by:mbizup
ID: 37816989
Sorry I missed your follow up question.

The reason you were seeing "all or none" with the solution I posted is most likely because you are using continuous forms (all unbound controls "look" the same).  That solution would have worked out okay with a form in single form view.

It's always a good idea to include a note in your original post to make it clear when you are using continuous forms or datasheets.  The solutions are generally straight forward  -- but different depending on the form view.

Glad you've got it resolved, and thanks for posting the solution.
0
 

Author Closing Comment

by:Megin
ID: 37831679
I found the solution on another website and wanted to close out this question. Someone on UtterAccess gave me the answer I needed.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question