473,406 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How Do I Check Date Control is Filled

269 256MB
{NeoPa - Split from Hide labels and textboxes}

Greetings NeoPa. Just when you thought I was gone for good...I'M BACK! Apparently database skills make for good job security because they keep giving me more and more and more. :-) Anyway, on with the problem.

I tried your code above, here's mine.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
  2.  Me!GalvDate2.Visible = (Me!GalvDate2 > "")
  3. End Sub
  4.  
My error says Run Time Error 13 Type Mismatch.
I suppose this is because I'm dealing with a date field and the code references an integer??? Thoughts??
Jan 15 '15 #1

✓ answered by NeoPa

Hello Danica my dear :-)

Your problem here is simply trying to compare a TextBox control containing date data with an empty string. The important word in that last bit is string.

As TextBox controls contain Nulls when they are not used you can say :
Expand|Select|Wrap|Line Numbers
  1. Me.GalvDate2.Visible = Not IsNull(Me.GalvDate2)
Does this mean that the code I posted in the other thread was imperfect? Yes! Sorry :-(

PS. It's great to hear from you again. Please do make contact on Skype when you can.

3 932
NeoPa
32,556 Expert Mod 16PB
Hello Danica my dear :-)

Your problem here is simply trying to compare a TextBox control containing date data with an empty string. The important word in that last bit is string.

As TextBox controls contain Nulls when they are not used you can say :
Expand|Select|Wrap|Line Numbers
  1. Me.GalvDate2.Visible = Not IsNull(Me.GalvDate2)
Does this mean that the code I posted in the other thread was imperfect? Yes! Sorry :-(

PS. It's great to hear from you again. Please do make contact on Skype when you can.
Jan 18 '15 #2
DanicaDear
269 256MB
Wh wh whaaaaat??? You posted code that was imperfect?! GET BACK! I love it! LOL

Ok, this worked!! I applied it to a total of 8 controls (dates, textbox, and a combobox) and all worked. I also applied it to the label.
For those wondering,
Expand|Select|Wrap|Line Numbers
  1. Me.LabelName.Visible = Not IsNull(Me.GalvDate2)
because if the control is null then I don't need a label. :-)

Thank you so much, as always!!
Jan 19 '15 #3
NeoPa
32,556 Expert Mod 16PB
DanicaDear:
Wh wh whaaaaat??? You posted code that was imperfect?! GET BACK! I love it! LOL
Give me a break girl!! That was posted before you were born almost (22 Jan 2007) :-D

Actually, almost exactly three months after I joined the site, so very early in my time of concentrating on Access as a speciality.

Of course I do!

That's the answer to your follow up question or accusation - "But surely you still make errors even now - even if not very often?".

We are all learning all the time (If we're still alive). That is just as true for those of us with a lot of experience as it is for those with less. Otherwise it would be pretty boring TBF.

Always fun :-)
Jan 23 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Adrian | last post by:
Access 2000 I want to run some code on the Form_BeforeInsert event. But if the user is entering data into one particular text box I do not want the code to run. Something like... If user not...
6
by: Mike | last post by:
I am just beginning with VB and had been using a crippled version of VB 6.0 which works fine except there's limited information resouces with it. So, like a good scout, I got a learning edition of...
2
by: Steve | last post by:
I'm starting a smartdevice project and cannot find the monthview or any date control in the tools. If I need to buy or download a 3rd party control, where can i look??? Thanks in advance, steve
1
by: Sridhar | last post by:
Hi, I have a web form which has two text boxes and a datagrid in it. The two text boxes will have start date and stop date. I have a calendar pop-up control that fills the start date and stop...
0
by: brandonjack007 | last post by:
I am looking for a date custom web server control that exntends from System.Web.UI.WebControls The control will expose the following Properties Date (datetime) Month (int) Day (int) Year...
2
by: nologo | last post by:
Hi, Visual Studio 2005, C#.net I wish to return a NULL value from a date control if no date is selected. Anyone got any idea on how i would do this? Cheers
1
by: PatdeLux | last post by:
Hi, I have have an Access 2003 application with Sql Express as back end. After migrating the front end to Access 2007, users have a serious problem: One form contains text controls bound to...
10
by: viki1967 | last post by:
Help with check date and hours Hi all. I have this form: <html> <head>
15
by: noclueforid | last post by:
Hello! On my main form I have two date controls, dtmTrainingStartDate and dtmTrainingEndDate. On a sub form, I have a date control dtmWeekEndingDate. What I would like to do is auto-populate the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.