473,811 Members | 4,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MSGBox: Check empty date field, checkbox control

Dököll
2,364 Recognized Expert Top Contributor
Me again!

I have been battling this one for months. Wrote below to aid in getting certain subforms to hide once checkbox named Active is clicked. I am hoping to make the code work for Date fields that may be empty. I think i am going about it the wrong way:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Active_BeforeUpdate(Cancel As Integer)
  2.  
  3. 'On current event of main form
  4. 'Check if checkbox is selected
  5. 'then show or hide subform
  6.     If Me.Active = True Then
  7.         Me.InfoOnly.Visible = True
  8.     Else
  9.         Me.InfoOnly.Visible = False
  10.     End If
  11. End Sub
  12.  
  13.  
I tried:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Active_BeforeUpdate(Cancel As Integer)
  2.  
  3. 'On current event of main form
  4. 'Check if checkbox is selected and contact date field is empty
  5. 'then pop up an error message
  6.  
  7.     If Me.Active = True And Me.ContactDate Is Null Then
  8.         MsgBox "Please add a contact date to continue..."    
  9.     Else
  10.         ...
  11.     End If
  12. End Sub
  13.  
  14.  
It is not working. In fact, now and then I get an error that something or other is missing, not always, but I do get that. For now, I get nada, code is mute, no errors though, just does not do anything;-)

Can you help? Thanks!

Dököll
Nov 30 '07
10 5035
Dököll
2,364 Recognized Expert Top Contributor
Dokoll,
This link should help you with screening the emails:

http://www.fabalou.com/Access/Modules/reading_email.asp
Neat, will give that a whirl...

Good afternoon:-)
Dec 13 '07 #11

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

Similar topics

2
5998
by: js | last post by:
Hi all, I currently encounter a problem and it is urgent to me. After calling the MsgBox.Show(), the message box is shown with non-modal mode, what is the possible reason??? This only happen in the VB project, works fine in C# project. SystemModal and ApplicationModal MsgBoxStyle were all tried and there was no help.
17
14126
by: jdph40 | last post by:
Question 1: In Access 97, I have a form (frmVacationWeeks) with a subform (sbfrmPostVacDates). The subform can have up to 33 records and each record has 2 checkboxes, one for approved and one for rejected. A supervisor opens frmVacationWeeks and either approves or rejects dates the employee has requested for vacation. When the supervisor closes frmVacationWeeks, if he has failed to click a checkbox to approve or reject a date, I want a...
8
10413
by: Lyn | last post by:
I am trying to get my head around the concept of default, special or empty values that appear in Access VBA, depending on data type. The Access Help is not much (help), and the manual that I have is not much help here either. Googling has given me a little help. This is my current understanding -- I would appreciate any comments or corrections... "" -- this means an empty string when applied to String data type, and also to Variant...
1
1809
by: Neal | last post by:
HI all, I have an issue with check box in datagrid. I would like it to check and uncheck based on a database value of NULL or a Date Value. If there is a date value for that column then check the check box in datagrid If the value is null then keep it unchanged as (Unchecked)
1
4240
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get the example to work. I created the following two classes, provided with the example: *-*-**-*-*-*-*-*-*-*-*-*-**-*-*-*-*-CheckBoxColumn Class:-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-**-*-*-*
3
5977
by: luanhoxung | last post by:
hi all ! i have a date & time picker control bound to 1 field. it worked fine. But i always get the message :" Can't set value to Null when checkbox properties = FALSE" when i open my form. there isnot any checkbox or proceduce on my form. if the D&T picker control is unbound to any field, no message appear. Can anyone explain to me what is trouble ? Thanks ur time visitting my post. Luan from VietNam
4
2250
by: andrewbda | last post by:
I have tickbox on a form, and I would like to use a date field as the control source. i.e. I would like to have it display as ticked when a date exists in the field, and vice versa. Also, when it is either checked or unchecked, I would like it to stamp todays date or remove the date from the control source. I can see how to do this if there are seperate fields for the checkbox and date, but I would like to combine them into one field...
3
5961
by: jomats | last post by:
I am a newbie trying to learn Access from several books. I'm sure this is an easy one to answer..for someone, not me. Is it possible to insert a checkbox on a form which, when checked, inserts the current date into one of the fields in the form? In Design View I put a checkbox alongside a field (Honorarium1). I clicked to select it, then in its Properties I typed Honorarium1 as the Control Source. When I clicked in the checkbox in...
1
1537
by: AP | last post by:
I am creating a database form that has a date field and a check box. When a user enters a date then I want the check box to automatically be null and if no date is entered I want the check box to be ticked. I am quite new to access to please only easy solutions Many Thanks
0
10644
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10127
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9201
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7665
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4336
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.