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
> Set Condition In Value Is Null    
 
   
mmchaley
post Jun 1 2020, 05:26 PM
Post#1



Posts: 67
Joined: 26-April 16



Hello everyone

I am working on an access 365 database. I am developing a report and need some VB help. (actually I need a LOT of VB help, but one step at a time)

I am a neophyte at VB and programming in any language (I include English in that as well) smile.gif

What I have

I have a control named [SoWDated] with the following control source =Format("SOW Dated ") & Format([SoWDate],"dd mmm yyyy") on my report

In some records the [SoWDate] is null

Normally I would just use a conditional format to set the forecolor to white when SoWDate is null. However the client wants a color coded report.

I have figured out (with help) how to set my forecolors if specific conditions are met with a value, to either hide what a control reports or to highlight it.

I am however having a difficult time getting the [SoWDated] to match the backcolor when [SoWDate] is null. I have watched a couple videos and had my mind twisted around on Microsofts help page.

Let me know if I need to add more info.

Thanks,
Mark
This post has been edited by mmchaley: Jun 1 2020, 05:27 PM
Go to the top of the page
 
theDBguy
post Jun 1 2020, 05:41 PM
Post#2


UA Moderator
Posts: 78,496
Joined: 19-June 07
From: SunnySandyEggo


Hi Mark. Are you trying to color the font or the box?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
RJD
post Jun 1 2020, 05:59 PM
Post#3


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


Hi Mark:

QUOTE
I am however having a difficult time getting the [SoWDated] to match the backcolor when [SoWDate] is null.

Let's see if I understand your issue. You have the colors taken care of if the date is present, but when the date is Null, you are trying to match the fore color to the background so it does not show. Is that right? Why not just Null out the textbox contents if the date is Null ...

=IIf(IsNull([SoWDate]),Null,"SOW Dated " & Format([SoWDate],"dd mmm yyyy"))

Note that the Format function is not necessary around the literal ...

Or am I not understanding your issue?

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
 
mmchaley
post Jun 2 2020, 02:12 PM
Post#4



Posts: 67
Joined: 26-April 16



to theDBGuy - Yes, I was trying to color the font

to RJD - Thanks, I see that will work. I didn't even think that direction. Very much a novice at programming so when i get an path that works I run that path until I fall off the cliff.

This will help me on a few other fields - thanks
Go to the top of the page
 
RJD
post Jun 2 2020, 03:22 PM
Post#5


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


You are very welcome. Continued success with your project ...

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
 


Custom Search


RSSSearch   Top   Lo-Fi    14th July 2020 - 08:08 AM