473,383 Members | 1,952 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,383 software developers and data experts.

Insert current date using checkbox

1
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 form view 12/29/1899 appeared in the Honorarium field. huh??? I tried changing the Control Source to another field in the form and nothing came up when i tested it. I checked my underlying table and didn't have that odd date anywhere in in the table.

I'm also wondering if I can place checkboxes next to several other fields on the form as well. The form lists several milestones that occur at different dates and I want to avoid having to type the current date into each of them for each record. Same procedure?

Thank you. Joan
Aug 4 '07 #1
3 5917
NeoPa
32,556 Expert Mod 16PB
You have (accidentally) posted this question in the Access Articles section. This is NOT an article.
I'm moving this to the main Access questions forum.

MODERATOR.
Aug 4 '07 #2
NeoPa
32,556 Expert Mod 16PB
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 form view 12/29/1899 appeared in the Honorarium field. huh??? I tried changing the Control Source to another field in the form and nothing came up when i tested it. I checked my underlying table and didn't have that odd date anywhere in in the table.

I'm also wondering if I can place checkboxes next to several other fields on the form as well. The form lists several milestones that occur at different dates and I want to avoid having to type the current date into each of them for each record. Same procedure?

Thank you. Joan
You can use a CheckBox if you like, but various other programmable events could also be used. A CheckBox is probably not the most appropriate in the circumstances, as unchecking it later wouldn't make much sense. What about using the Double-Click event of the control you're using to store the date field in? In the event property just have some code to say :
Expand|Select|Wrap|Line Numbers
  1. Me.[YourDateControl] = Date()
Aug 4 '07 #3
missinglinq
3,532 Expert 2GB
NeoPa's suggestion is right on the money! Replacing YourDateField in the following code
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourDateField_DblClick(Cancel As Integer)
  2.   Me.YourDateField = Date()
  3. End Sub
  4.  
with the actual name of your date field will allow your users to assign the current date to the field by double-clicking on it. You can repeat this for as many fields as is necessary.

12/29/1899 is the date Access defaults to, if you will, when a non-date is assigned to a field whose datatype is defined as Date/Time.
I clicked to select it, then in its Properties I typed Honorarium1 as the Control Source.
This has assigned a date field Honorarium1 as the Control Source of a checkbox, which has a datatype of Yes/No, which is confusing Access. You need to go back into the Properties box and delete this.

Welcome to TheScripts, Joan!

Linq ;0)>
Aug 5 '07 #4

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

Similar topics

3
by: jason | last post by:
How does one loop through the contents of a form complicated by dynamic construction of checkboxes which are assigned a 'model' and 'listingID' to the NAME field on the fly in this syntax:...
18
by: Robin Lawrie | last post by:
Hi again, another problem! I've moved from an Access database to SQL server and am now having trouble inserting dates and times into seperate fields. I'm using ASP and the code below to get the...
9
by: cavassinif | last post by:
I need to dynamic select a column in which insert a vale based on a parameter value, I have this code, but it throws an incorrect syntax error. How do I dinamically select a column to insert...
6
by: rn5a | last post by:
During registration, users are supposed to enter the following details: First Name, Last Name, EMail, UserName, Password, Confirm Password, Address, City, State, Country, Zip & Phone Number. I am...
1
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
11
by: TechnoAtif | last post by:
INSERT AND UPDATE MULTIPLE CHECKBOX DATA USING PHPMYSQL OR JAVASCRIPT Hi All I want to check the multiple checkboxes update them after revisiting that page. I am taking the name as...
0
by: gpspocket | last post by:
help me -CURSOR backward insert from End Date > to Start Date how to insert dates from end to start like this SELECT 111111,1,CONVERT(DATETIME, '17/03/2008', 103), CONVERT(DATETIME,...
5
ddtpmyra
by: ddtpmyra | last post by:
I don’t know if I posted my question on the right forum if not my bad, but I’m having trouble how to create a php script that will insert data on mysql Scenario: I have 3 checkbox on my form and...
58
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.