UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Change Text Color In A Table?, Access 2000    
 
   
wmix
post Apr 9 2019, 05:23 PM
Post#1



Posts: 43
Joined: 12-April 17



Hi Everyone,
I'm not sure it's even possible, but I cannot seem to find an answer directly. I've found a lot of information about using conditional formatting but that's not an option on a table. I was thinking that it sure would be nice to have this type of formatting at a basic table level (thought maybe it's just not an access option).

I table with basic info in it including:
MachineID (PK)
MachineName
InactiveDate
etc...

What I was hoping was that if InactiveDate is not NULL then everything associated with that MachineID (the row) would be a different color than black text. Or the background could be light grey or something.

I was hoping this would allow users to instantly spot "inactive" machines on a form in a combo box, list box, etc.

If it cannot be done on a table level can anyone offer advice on doing it using SQL in a query so a combo box or list box based on a query has the color formatting?

Thank you for any advice you can offer.
Go to the top of the page
 
DanielPineault
post Apr 9 2019, 05:36 PM
Post#2


UtterAccess VIP
Posts: 6,714
Joined: 30-June 11



No, it is not possible.
Since no one should directly be using tables, this wouldn't make sense. Data should be accessed through forms where you can add control, validation and ... conditional formatting. Simply create a continuous form and add the appropriate conditional formatting and you'll be set.

--------------------
Daniel Pineault (2010-2019 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
wmix
post Apr 10 2019, 02:01 PM
Post#3



Posts: 43
Joined: 12-April 17



Thank you Daniel for your reply.
I do have it set up so the end-users are not using the table.
I was just trying to come up with a way to easily identify these specific machines for end-users when they look at a combo box or list box when searching for a machine.
I'll see what else I can figure out.
Go to the top of the page
 
RJD
post Apr 10 2019, 02:20 PM
Post#4


UtterAccess VIP
Posts: 9,731
Joined: 25-October 10
From: Gulf South USA


Hi:

QUOTE
I was just trying to come up with a way to easily identify these specific machines for end-users when they look at a combo box or list box when searching for a machine. I'll see what else I can figure out.

Here's an idea ... in the row source query for the combobox or listbox (if a table now, make it a query) add a field like this ...

Status: IIf(Not IsNull([InactiveDate]),"Inactive","") ... Design View format

... then show this column in the combobox or listbox (add a column to the column count and give it a width). This can be the indicator instead of a color.

Or, if you don't want the user to ever choose an inactive machine, just use a WHERE clause in the row source query to eliminate them.

Just a thought.

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
wmix
post Apr 11 2019, 12:51 PM
Post#5



Posts: 43
Joined: 12-April 17



Thank you Joe.
I'll take a look and see if I can figure this out.
I never thought it was an issue until the company owner sat down to use the system one day and mentioned it was confusing. Unfortunately we cannot hide the inactive machines because sometimes we have to look back at them.
Go to the top of the page
 
RJD
post Apr 11 2019, 06:48 PM
Post#6


UtterAccess VIP
Posts: 9,731
Joined: 25-October 10
From: Gulf South USA


You are very welcome.

Let us know if we can assist you further in setting this up. If so, that will usually require you posting a cutdown db with relevant objects (no sensitive data of course, and zipped).

Best of luck ...

Regards,
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
isladogs
post Apr 12 2019, 01:39 AM
Post#7


UtterAccess VIP
Posts: 1,453
Joined: 4-June 18
From: Somerset, UK


Whilst I agree with previous advice, you can do some formatting in queries, listboxes, comboboxes and indeed tables.
This article on my website give an idea about what is possible Add Colour

--------------------
Go to the top of the page
 
Bullschmidt
post May 11 2019, 02:16 AM
Post#8



Posts: 12
Joined: 8-May 19



And here's a related article that may give you some ideas...

MS Access 2007: Conditionally change the background color of a text box on a Continuous Form
Go to the top of the page
 
tina t
post May 11 2019, 11:36 PM
Post#9



Posts: 5,982
Joined: 11-November 10
From: SoCal, USA


the Add Colour article at Colin's link was very interesting. i was able to change the forecolor of fields in a table, and in a query, in my A2000 db, using the example Format from the webpage, as

[Green]#;[Red]#;[Blue]"Zero";[Cyan]"Nothing Entered"

i expect it would work in an A97 db also, though i can't test that assumption at home.

it worked in a combobox control in my A2000 db, but only on the selected value - no colors displayed in the droplist on a Number datatype field. this regardless of whether i formatted the field's Format property in the RowSource query, or the control's Format property - or both. it worked on Null/Not Null values in a Text field, though, in both the combobox droplist and selected value.

i couldn't get it to work in the listbox control at all on a Number data type. no colors applied to the displayed list values, with the field's Format property set in the listbox's RowSource query. and, interestingly, there is no Format property listed in the control's Properties box. but a Text data type field, formatted in an query as the listbox RowSource, did display Null/Not Null values appropriately whether a row was selected or not.

i did download the ColourQuery v2 from the website, but since it's an accdb file type, i couldn't open it to see what techniques were used on a listbox control, and if i might be able to use it/them on a listbox control in A2000.

QUOTE
You can of course change the background colours for queries/tables as well

i didn't find any examples of how to do this, on the webpage, and as mentioned couldn't open the downloaded db, so i don't know if the technique(s) used could work in .mdb databases.

QUOTE
if InactiveDate is not NULL then everything associated with that MachineID (the row) would be a different color than black text. Or the background could be light grey or something.

as for the op's specific "wish" for formatting, i didn't see/test any technique that would work under the conditions stated above, at least in an A2000 .mdb file.

hth
tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 
isladogs
post May 12 2019, 01:36 AM
Post#10


UtterAccess VIP
Posts: 1,453
Joined: 4-June 18
From: Somerset, UK


Hi Tina
In A2010, you can change the background colour by clicking that button on the ribbon.
Attached File  Capture.PNG ( 23.08K )Number of downloads: 2

I haven't checked but suspect that property wasn't available in earlier versions.

I've attached a MDB version in A2000 format so you can test and see what functionality is available to you.
I have to admit that I've hardly ever found a use for this feature and it won't solve the OP's issue.
Attached File(s)
Attached File  ColourQuery_v2_MDB_2000.zip ( 25.46K )Number of downloads: 3
 

--------------------
Go to the top of the page
 
gemmathehusky
post May 12 2019, 04:25 AM
Post#11


UtterAccess VIP
Posts: 4,722
Joined: 5-June 07
From: UK


You REALLY REALLY do not want people messing about changing data in tables OR queries.

You can add in loads off application logic to permit certain changes, which works great in forms - once you let users change data directly in a table, all of this is out of the window ….

--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 
DanielPineault
post May 12 2019, 08:36 AM
Post#12


UtterAccess VIP
Posts: 6,714
Joined: 30-June 11



QUOTE
You REALLY REALLY do not want people messing about changing data in tables OR queries.

This should be the take away from the entire question.

If done properly, using a form, the entire issue is very easy to address using built-in conditional formatting (or if you want to get fancy VBA).

--------------------
Daniel Pineault (2010-2019 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
isladogs
post May 12 2019, 03:08 PM
Post#13


UtterAccess VIP
Posts: 1,453
Joined: 4-June 18
From: Somerset, UK


Hey. Don't shoot the messenger. shrug.gif
I totally agree that end users should not be editing data in tables or queries.

The reason I mentioned colour formatting in tables, queries, listboxes and combos in post #7 was purely to clarify an earlier statement that suggested it wasn't possible.
Any formatting is, of course, also carried forward into form datasheets.
The feature is limited in scope and nowhere near as powerful as conditional formatting but it may be of use in certain cases.

The follow up post was to provide an MDB version for Tina who wanted to look into the possibilities further.




--------------------
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    18th July 2019 - 08:06 AM