TheCaptain
Dec 7 2006, 10:52 PM
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
doran_doran
Dec 7 2006, 11:40 PM
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
niesz
Dec 7 2006, 11:47 PM
You can also use a bit of Boolean logic...
Me.YourCheckBox = (IsDate(Me.Txt1) And Not IsDate(Me.Txt2))
TheCaptain
Dec 8 2006, 12:09 AM
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
TheCaptain
Dec 8 2006, 12:17 AM
Walter,
Thanks for the tip.
TheCaptain
niesz
Dec 8 2006, 12:17 AM
NP.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.