473,809 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tick Box as Date Field

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 if possible.

Thanks in advance for any help!!!

Jan 4 '07 #1
4 2249
On 4 Jan 2007 05:43:52 -0800, "andrewbda" <an*******@gmai l.comwrote:

You need only a single date field in your table. The field could be
"displayed" in an eventually hidden but for debug purposes visible
textbox. Then you create an unbound checkbox, and set its
controlsource to:
=Not Isnull(<your_da te_field>)

-Tom.

>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 if possible.

Thanks in advance for any help!!!
Jan 4 '07 #2
Thanks,

I know how to have the checkbox indicate whether there is data in the
field or not, but I would also like it ot be able to insert/delete the
date when ticked/unticked, this is the part I am having trouble with.

Will " =Not Isnull(<your_da te_field>)" accomplish this?
Tom van Stiphout wrote:
On 4 Jan 2007 05:43:52 -0800, "andrewbda" <an*******@gmai l.comwrote:

You need only a single date field in your table. The field could be
"displayed" in an eventually hidden but for debug purposes visible
textbox. Then you create an unbound checkbox, and set its
controlsource to:
=Not Isnull(<your_da te_field>)

-Tom.

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 if possible.

Thanks in advance for any help!!!
Jan 4 '07 #3
"andrewbda" <an*******@gmai l.comwrote in message
news:11******** **************@ s80g2000cwa.goo glegroups.com.. .
>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 if possible.

Thanks in advance for any help!!!
If you have a text box on your form which is bound to your date field then
you could then use If ... Then clauses in the form's Current event to test
for the presence of data and populate your check box accordingly.
Similarly, you could have code in the check box's update event to influence
the contents of the text box. Untested, but should get you started:

Form Current event:

If IsNull(Me.txtDa te) Then
Me.chkDate = 0
Else
Me.chkDate = -1
End If

Check box Update event:

If Me.chkDate Then
Me.txtDate = Date()
Else
Me.txtDate = Null
End If
Me.Refresh

HTH - Keith.
www.keithwilby.com
Jan 4 '07 #4
On 4 Jan 2007 06:19:42 -0800, "andrewbda" <an*******@gmai l.comwrote:

No it won't. That expression only sets the value of the checkbox based
on whether there is a date or not.
If you want check/uncheck to set/clear the current date, I would write
my code in the <checkbox>_Afte rUpdate event:
if Me.<checkbox= True then
Me.<your_date_f ield= Date()
else
Me.<your_date_f ield= Null
end if

-Tom.

>Thanks,

I know how to have the checkbox indicate whether there is data in the
field or not, but I would also like it ot be able to insert/delete the
date when ticked/unticked, this is the part I am having trouble with.

Will " =Not Isnull(<your_da te_field>)" accomplish this?
Tom van Stiphout wrote:
>On 4 Jan 2007 05:43:52 -0800, "andrewbda" <an*******@gmai l.comwrote:

You need only a single date field in your table. The field could be
"displayed" in an eventually hidden but for debug purposes visible
textbox. Then you create an unbound checkbox, and set its
controlsourc e to:
=Not Isnull(<your_da te_field>)

-Tom.

>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 if possible.

Thanks in advance for any help!!!
Jan 5 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3443
by: G | last post by:
I have this field which is called "Statement Sent". It is a tick box. There is another field called "Statement Sent Date". Its a date field. How can I have the current date automatically populate the "Statement Sent Date" field once the "Statement Sent" tick box is ticked. Would it require an expression in the query ? Or a VB expression (which I'm not that great in ). Any assistance would be appreciated.
3
12975
by: BlackFireNova | last post by:
This concerns an Access 2002 (XP) database. There are two fields, "Notes" (Memo Field) and "Notes Update" on a form (among others) which I am concerned with here. Problem: I need to be able to tell when people have added notes to a record. (this database contains 6000+ records) I want to set it up so that "Notes Update" is updated to the current date whenever someone actually enters data into, or modifies data in, the "Notes"...
3
2574
by: captain | last post by:
Below is the sql for data with same date need to extract + or - 5 days data of same date also. How to also get data of + and - days related to same date. SELECT IM.Area, IM.Location, IT.itemid, IT.date,
7
9613
by: TimC | last post by:
Hello all, A question from someone who dabbles in Access. Is it possible to hide or ghost out a combo box (or set of them) on a Form, and only have them appear as a usable option if a tick box option that is also on the form is ticked or marked as true ??.... I am asking this as I want to prevent people entering the data into these combo boxes unless they have selected this tick box. I have a few queries that primarily look at the Yes/No...
6
12565
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a calendar control to allow my users to enter a date but I need them to enter a time as well. It doesn't look like the calendar control will allow times to be entered so I was thinking of having two text boxes. One text box would contain the date...
2
1373
by: Dixie | last post by:
I have a table with records where each record has 14 tick boxes. Simply speaking, I want a report which shows each record for which any of the tick boxes is not ticked. It sounded simple until I started to try to do it. The only records I don't want are ones for which all 14 ticks are present. dixie
2
2687
by: xnatty89xx | last post by:
I know this is probably a fairly simple question but i am relatively new to databases. I have created a database for a riding school which records when people book a lesson, if they have paid a tick box in a filed named "paid" is ticked to say they have done so. There is also a field named "money owed" which I wish to display the amount a person owes if they have not paid for the lesson. I was wondering if it is possible to give a value to a...
4
3205
by: paul.bentley | last post by:
I am trying to get a "Date entered" box to automatically fill when a tick box = true, without success so its over to the experts for some much needed help Thanks in advance
0
10637
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
10376
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...
0
10115
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...
1
7660
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
5550
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...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
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
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3014
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.