×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Conditional Formatting of a string

Conditional Formatting of a string

Conditional Formatting of a string

(OP)
Hi

I'm trying to colour code a text box based off values in a string.

the string value in the query looks like

CODE

Val: Min([lngSessionTypesID]) & Chr(13) & Chr(10) & Min([strRepValue]) 

this outputs values

25
B2

how do I get it to colour the text box based off of a string value which might be the second part of the string

The first string value "25" is a booked session, the second string value "B2" is if the session is funded

I've tried various ones:

InStr([Mon],"B2") Or ([FundedDesc] Like "Parent*")
InStr(1, [Mon], "B2”) <> 0 AND [FundedDesc] Like "Parent*"

I'm sure there is a simple solution

Mikie

RE: Conditional Formatting of a string

I'm confused. You have a column name Val that is made up of two fields lngSessionTypesID and strepValue but your conditional formatting expression contains[Mon] and [FundedDesc].

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Conditional Formatting of a string

(OP)
to be fair, i'm not sure what i'm doing.

i was trying to use your crosstab query you helped me with a while ago which works perfectly, the full query i'm using for this new problem is:

CODE

TRANSFORM Min([FundedDesc]) & Chr(13) & Chr(10) & Min([lngSessionTypesID]) & Chr(13) & Chr(10) & Min([strRepValue]) AS Val
SELECT qryAttendanceEntry_v2Test.NurseryId, qryAttendanceEntry_v2Test.Nursery, qryAttendanceEntry_v2Test.strRegisterSort, tblRegisterRooms.lngRoomRegisterNo, tblRegisterRooms.strRoomRegisterDesc, qryAttendanceEntry_v2Test.strFundedOption1Desc, qryAttendanceEntry_v2Test.FundedDesc, qryAttendanceEntry_v2Test.dteDOB, qryAttendanceEntry_v2Test.lngChildID, qryAttendanceEntry_v2Test.childsname, qryAttendanceEntry_v2Test.strCurrentSessionTermNonDesc, qryAttendanceEntry_v2Test.lngMONFund, qryAttendanceEntry_v2Test.lngTUEFund, qryAttendanceEntry_v2Test.lngWEDFund, qryAttendanceEntry_v2Test.lngTHUFund, qryAttendanceEntry_v2Test.lngFRIFund, qryAttendanceEntry_v2Test.strRegisterGrp
FROM tblRegisterRooms INNER JOIN qryAttendanceEntry_v2Test ON (qryAttendanceEntry_v2Test.strRegisterSort = tblRegisterRooms.lngRoomRegisterNo) AND (tblRegisterRooms.lngRoomRegisterNurseryID = qryAttendanceEntry_v2Test.NurseryId)
GROUP BY qryAttendanceEntry_v2Test.NurseryId, qryAttendanceEntry_v2Test.Nursery, qryAttendanceEntry_v2Test.strRegisterSort, tblRegisterRooms.lngRoomRegisterNo, tblRegisterRooms.strRoomRegisterDesc, qryAttendanceEntry_v2Test.strFundedOption1Desc, qryAttendanceEntry_v2Test.FundedDesc, qryAttendanceEntry_v2Test.dteDOB, qryAttendanceEntry_v2Test.lngChildID, qryAttendanceEntry_v2Test.childsname, qryAttendanceEntry_v2Test.strCurrentSessionTermNonDesc, qryAttendanceEntry_v2Test.lngMONFund, qryAttendanceEntry_v2Test.lngTUEFund, qryAttendanceEntry_v2Test.lngWEDFund, qryAttendanceEntry_v2Test.lngTHUFund, qryAttendanceEntry_v2Test.lngFRIFund, qryAttendanceEntry_v2Test.strRegisterGrp
ORDER BY qryAttendanceEntry_v2Test.NurseryId, qryAttendanceEntry_v2Test.strRegisterSort, qryAttendanceEntry_v2Test.childsname
PIVOT qryAttendanceEntry_v2Test.DofWeek In ("Mon","Tue","Wed","Thu","Fri"); 

The column headings are "Mon", "Tue, "Wed, "Thu", "Fri" which is why i'm using the expression

CODE

InStr([Mon],"B2") 

but i can see why this doesn't make any sense when the Val is pulling through different field names.

RE: Conditional Formatting of a string

I expect you are using "Expression Is" in the conditional formatting. I would start with something very simple like: InStr(1, [Mon], "B2”) <> 0 and see if it works. Then add to it as needed.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Conditional Formatting of a string

(OP)
Thanks for your help again Duane, got the report to colour code things

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close