Input Current Date Into A Field By Clicking Checkbox

Oct 5, 2004

Does anyone know how to automatically enter the current date into a specified field by simply clicking on a check box. I imagine the IIf function would work when entered into 'Control Source' but I also need the check box to be linked to the underlying table.
i.e. I tick the 'Paid' checkbox and the current date is automatically entered into the 'Date Sold' field. I also need the -1 generated by clicking on the checkbox to be stored in the table.

Any suggestions would be appreciated, although I am no good with code, so if you could post an example or an easier way to do it I would be most grateful

View Replies


ADVERTISEMENT

Modules & VBA :: Checkbox True When Current Date Is Passed

Dec 3, 2014

I have a form that allows you to search for records and displays all the information for that project, typical stuff.

On this form is a subform with the followings Fields:

Inspection Requested, Inspection Due, Inspection Done, Overdue

When you update inspection requested the inspection due is automatically updated to 30 work days from that day.

Now what I'm trying to do is get the overdue field (it's a yes/no field) to automatically check itself when the current date is passed the inspection due and the inspection done field is blank.

Here's what I have that isn't working:

Code:
Private Sub Form_Current()
If DateAddW([REQUEST], 30) < Date And [INSPECT DONE] = 0 Then
[OVERDUE] = True
End If
End Sub

DateAddW is a UDF that works just fine. I've tried replacing 0 with Null and neither works.

View 4 Replies View Related

Can I Use Checkbox To Trigger Field Input?

Oct 21, 2004

Here is what i want to do:

I have a main order form with a subform for order datails (products, quantity, extended price, etc..). The default way of calculating a selling price is by using the cost plus a profit margin (the margin is a percentage defined on the main form)

But sometimes we want to define the selling price differently, bu using the List price instead, on which I can apply a discount. So what I did is put a checkbox field on my subform, and when the checkbox is "true" the selling price is now the list price field from the products table instead of the "cost plus" calculated field.

So far everything works perfectly as described. The only that I am now left to do is to be able to "ask" for the desired discount when the checkbox is selected. What I mean is that when the checkbox is clicked (true), I would like for a dialog box to pop-up and ask for the discount that should be applied to that record in the subform...Is there a way to do that with a "msgbox" or should I make a small form with only one field on it?...

The main reason why I want to do it this way is that I dont want to put the "discount" field on my subform as it would be on every item line and it is used only rarely because 90% of the pricing are bases on "cost plus".

View 1 Replies View Related

Lock A CheckBox After Clicking

Feb 14, 2005

Hi Guys,

I have a form which is called test and in there a have a button box. What I want to do is Disable that Button box (its not a tick box not sure if that makes any difference) after checking it...

http://www.access-programmers.co.uk/forums/showthread.php?t=81223

I have tried the above to no luck :confused: I do have a auto insert date macro in the after update would that matter?

Thanks for any help, Please let me know if you need more info im fairly new to this

View 2 Replies View Related

How To Add A Record Just By Clicking CheckBox

May 1, 2006

Hi,

I have this form which have some text fields and CheckBox list or Option list, you fill the text fields then chose from the option list then adding the record by clicking the button.

I want to change this so that by choosing any option fron the option list it will add the record automatically without clicking the button.

So please help how to do that.

View 7 Replies View Related

Modules & VBA :: Auto Populate A Date When Clicking On Another Field?

Apr 22, 2015

I would like a date field I have set up to auto populate the current date when I click on another field to enter information.. how would I do that?

View 5 Replies View Related

Forms :: Clicking Checkbox On A Subform To Pull Data From Textbox On Mainform

Nov 25, 2014

I have a Mainform [FrmReconcileMain] and it contains a Subform [FrmReconcilesub]

What I'm trying to is, on the Main form type in a statement date in textbox [TxtStatementDate].

I have a checkbox on my subform [ReconciledYN], along with a textbox [TxtReconcileDateSub]. when I click the checkbox, it simply pulls the date from the mainform and populates the date in the subform.

I've even tried experimenting on a simple form (with no subform) to see whats going on, but still I can't get it to work, even on a simple event such as this...

If [yourcheckboxname] = -1 Then [controlnametoupdate] = date() Else [controlnametoupdate] = ""

View 13 Replies View Related

Reports :: Showing Date Field Differently Depending On Current Date

Nov 23, 2013

I have a report that displays simple date fields. One of the fields is "lease execution". On the report, I want "lease execution" to display differently depending on the date the report was run.

So:

- If the "lease execution" date is more than 120 days away from today, I want it to display as Q YYYY.
- If the "lease execution" date is between 120 and 90 days away from today, I want it to display as MM/YYYY
- If the "lease execution" date is 90 days or less away, I want it to display the normal date MM/DD/YYYY

I was thinking I would need to do DateDiff() to figure out an amount of days that's between Now() and [Lease_Execution]. Then based on that amount make the report show it differently. Pseudocode would be: if DateDiff() = 40, then display [lease_execution] as MM/DD/YYYY

View 9 Replies View Related

Auto Fill Field In A Table By Comparing A Given Date Against Current Date?

Aug 18, 2015

I am building a database to track contract of employees so that I can know which contracts are valid and which are expired.

My table has the following fields:

ID (Primary key)
Employee ID (Foreign key to link to the employee table)
Start_Date
End_Date
Status (Either valid or expired)
Challenge

I want when I enter the end date, the system checks the end date against the current date and fills in the status field with either valid or expired as appropriate. For instance if the contract end date is March 10,2016, the status must be filled in the word valid.

View 3 Replies View Related

Forms :: How To Insert Current Date Into A Field Using Date

Oct 10, 2014

i have just started to use access and i know how to insert the current date into a field using date() but i am not sure will this change the date everytime i open the form ? i want to create a form for invoices that shows the date the invoice was created and doesnt change if i re open for editing,

View 1 Replies View Related

Putting In The Date After Field Is Input

Jan 26, 2006

Sorry guys, I thought this would be simpler than it was!

Basically I just want to update my "Resolution date" field with the date or time now (which I know how to do) but AFTER I input data in my "Resolution" field ie I want a field to automatically record what time I am entering the text in my "Resolution" field?

How do I do this, and can I do it without writing a macro? I thought it was along the lines of After Update, but now I am confused!

Thanks again - I am learning just slowly!

View 5 Replies View Related

OnClick Field Input Date

May 19, 2006

Hi All
Does anybody have or know how to make a field so when its clicked it will enter todays date, the default value =date() is not an option either.

Thanks for any help

View 1 Replies View Related

Updating A Field To Current Date

Feb 18, 2005

I have a form named 'Race'. It uses table 'Tasks'. I want to click a command button and have the 'Completed Date' field updated to the current date.

Can anyone tell me how to code the command button?

Thanks!

Sunny

View 2 Replies View Related

Current Date/Time Field

Mar 23, 2005

I have a form with date/time field. I have the default value at =Now(). My problem is I would like for this particular field to stay with the current date/time all the time. I mean if I created a form last week with the date/time of 3/14/2005 12:54:34 PM and go back to the same form to edit something this week I would like for that particular date/time to be the current date/time and not the date/time from the week and time the original form was created.

Thanks for any help!

View 1 Replies View Related

Enter Current Date Into Field Button!!!

Jun 28, 2006

What code would I use and how would I insert it into my Code to make a button on a form fill in the current date into [fieldname]???

I think I already know who is going to respond to this! ;)

Thanks! :D

View 9 Replies View Related

Tables :: Input Mask For A General Date Field?

Feb 8, 2013

I need an input mask for a general date field. When I add the date "11/01/2012 10:00:00" it works fine.

When I add an input mask of 00/00/0000 00:00 it then doesn't work.

View 2 Replies View Related

General :: Add A Field Which Returns Day Of Week From Current Date

Jul 5, 2012

Having a bit a brain freeze today. I have a field that auotmatically puts a date in when a checkbox is checked I am now trying to add a field which returns the day of the week from this date. Brain now mashed I am sure it's pretty simple but I just can't get it to work

View 5 Replies View Related

Entering Current Date In A Field Via Form Button?

Aug 16, 2012

I am trying to figure out to have the current date populate in table field by using a button on a form and not having much luck.

I have a table with 2 date fields, a 'created' field and a 'received' field. I already have the date set to auto populate for the 'created' field but I don't want the 'received' field to populate until the employee has gone into the database to receive the work.

I know I could have the employee just enter the date, but i want to avoid any typos or people simply forgetting to do it.

Ideally I would love the button to enter the current date into the 'received' field and save the entry, but I fine it needs to be 2 seperate buttons.

View 3 Replies View Related

Modules & VBA :: Current Checkbox Label Update

May 25, 2014

I have the following module which displays the backcolor of a checkbox label if it is true or false

Private Sub FormatLabel(chk As Control)
With chk.Controls(0)
If chk Then
.BackColor = vbYellow
.BackStyle = 1
.ForeColor = vbRed

[Code] .....

Which works great! But I cannot figure out how to make it work in the control AfterUpdate Event. I tried using it in the current control's (checkbox) after update event

Dim itm As Control
If itm.ControlType = 106 Then FormatLabel itm

but nothing happens (no change, no error message).

I have tried creating a new module:

Public Sub CheckBoxFormat(chk As Control)
If chk = -1 Then
chk.BackColor = vbYellow
chk.BackStyle = 1
chk.ForeColor = vbRed
Else
chk.BackColor = vbWhite
chk.ForeColor = vbBlack
End If
End Sub

But when I try to call it in the AfterUpdate event for the particular checkbox

Private Sub CheckBoxA_AfterUpdate()
Dim itm As Control
If itm.ControlType = 106 Then
CheckBoxFormat itm
End Sub

I get the error message "Expected Variable or Procedure not module"

So, (1) is my module all wrong or (2) am I calling it incorrectly or (3) wrong on both items?

View 13 Replies View Related

Queries :: Criteria That Looks For Records Like Current Year Only For A Date Field

Oct 12, 2014

How do you write a MS Access query criteria that looks for records like the current year only for a date field ? I tired Like *Year(Now()), it did not work.

View 8 Replies View Related

Queries :: Current Date Field From Form Inserting In Table

Mar 7, 2015

I have a form, has some fields, one of them is the current date, so when the user click (save )button , which make (add new record )to the only table I have the problem that .all fields are inserted in the table , except the current date !! it is a text box ( Now() )!!

View 1 Replies View Related

Reports :: Conditional Format Date Field For Current Month

May 20, 2014

I have a short date field 5/20/2014

I would like to set up a conditional format to format those fields in the current month. For example, this month is would format all fields with "5".

Next month all fields with "6"

In the month space.

I can't seem to figure out the expression, I know I'm close.

View 4 Replies View Related

Tables :: How To Display Default Value Of Date / Time Field For Current Year

Aug 20, 2013

All, using access 2010. How do I display the default value of a date/time field to just the current year instead of using =date() to get the full date.

View 5 Replies View Related

Update A Form Field By Double Clicking A Query Field

Apr 25, 2013

I have 3 peices of data that I am working with: Group number, plans and benefit elections. On my form I have fields for the group number and plan and 2 queries. When I enter a group number the first query displays a list of plan descriptions for that group. From there I can enter the plan description into the form's plan field and that runs the second query to give me a list of valid elections for that plan. This all works fine but I want to make the plan selection a little less tedious. What I would like is to be able to double click the query field housing the plan description and have it copied to the form's plan field. I could use the ID instead of the plan description but I work in a production environment and very key stroke counts so I would really like to have a simple double click process.

Is this even possible? If so how would I set that up? I tried using the double click on event macro builder but it does not seem to have this kind of option.

My form contains fields for group number and Plan. The same form houses 2 querys, one that pulls plans based on the group number and the other to pull elections based on the plan field (not the plan query). Would like to double click a plan within the plan query and have that description populated into the form's plan field.

View 6 Replies View Related

Forms :: Goto Form With Current User And Current Date

Aug 27, 2013

What I really need is for when the form opens, it looks at todays date, then matches current user and then goes to that record for today, if no current user there, then will goto new record..

i know, sounds complicated, and probably is really easy, but my heads not with it today, as about to get drunk as its my 40th, and got people ringing and texting and still trying to get this done....

I've included a copy of this database, named Timecards..

View 1 Replies View Related

Forms :: Create Button To Enter Current Date / Time In Field Where Cursor Is Presently Placed

Jan 14, 2014

Looking to create two command buttons or two keystrokes sets in an Access 2007 form that will allow me to place a current date and time in any allowable field where the Cursor is presently placed. Similar to what was in Access 2000, ctl: (for the current date) and ctl shift : (for the current time).

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved