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

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Check Box    
 
   
TheCaptain
post Dec 7 2006, 10:52 PM
Post #1

UtterAccess Veteran
Posts: 384
From: AZ



Hello UA Members,

On my form i have multiple text boxes and ONE Check box. What i would like to do make the check box true or false based on criteria from two of the text boxes.

For example:

txt1 = date
txt2 = date

if txt1 has date entered but NO date in txt2 i want the check box to equal true.
if txt1 has date entered but txt2 date is also entered then check box equals false.

any ideas?

thanks in advance

TheCaptain
Go to the top of the page
 
+
doran_doran
post Dec 7 2006, 11:40 PM
Post #2

UtterAccess Ruler
Posts: 1,454
From: Houston, TX, USA



if not isnull(me.txt1) and isnull(me.txt2) then
me.checkbox=1
elseif not isnull(me.txt1) and not isnull(me.txt2) then
me.checkbox=0
end if

You can also you case and select method. I used to used if a lot and now I am shifting toward case and select. It makes me look more pro. LOL
Go to the top of the page
 
+
niesz
post Dec 7 2006, 11:47 PM
Post #3

Utter A-fishin'-ado
Posts: 17,723
From: Cincinnati, Ohio, USA . . . ><((((°>



You can also use a bit of Boolean logic...

Me.YourCheckBox = (IsDate(Me.Txt1) And Not IsDate(Me.Txt2))
Go to the top of the page
 
+
TheCaptain
post Dec 8 2006, 12:09 AM
Post #4

UtterAccess Veteran
Posts: 384
From: AZ



Doran Doran,

Thanks, i got it to work. i was using the null statement wrong in VBA, thanks for setting me straight....lol

i see you're from Houston. I lived there for 5 years on the westwide (Richmond and beltway) i'm moving back there in a few years. I love that city. Take care!!

thanks again.

TheCaptain
Go to the top of the page
 
+
TheCaptain
post Dec 8 2006, 12:17 AM
Post #5

UtterAccess Veteran
Posts: 384
From: AZ



Walter,

Thanks for the tip.

TheCaptain
Go to the top of the page
 
+
niesz
post Dec 8 2006, 12:17 AM
Post #6

Utter A-fishin'-ado
Posts: 17,723
From: Cincinnati, Ohio, USA . . . ><((((°>



NP.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th May 2013 - 07:43 AM