A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Hard-coded date in an Access Form



 
 
Thread Tools Display Modes
  #1  
Old June 19th, 2009, 03:37 PM posted to microsoft.public.access.tablesdbdesign
millerwms
external usenet poster
 
Posts: 6
Default Hard-coded date in an Access Form

Good morning,

I have created a form for our field reps which they will be completing to
escalate an employee issue. One field I have in my bound table is "Date
Submitted". Instead of leaving this open and up to the rep to fill in (and
possibly back date!), I would like to hard-code for "today" to drop right
into that field within the form.

Could I create a macro to accomplish this? Any help or suggestions on how
to are greatly appreciated.

Regards,
Scott
  #2  
Old June 19th, 2009, 04:00 PM posted to microsoft.public.access.tablesdbdesign
Beetle
external usenet poster
 
Posts: 1,254
Default Hard-coded date in an Access Form

No macro or code necessary. Set the default value to;

Date()

which will return the current date.

--
_________

Sean Bailey


"millerwms" wrote:

Good morning,

I have created a form for our field reps which they will be completing to
escalate an employee issue. One field I have in my bound table is "Date
Submitted". Instead of leaving this open and up to the rep to fill in (and
possibly back date!), I would like to hard-code for "today" to drop right
into that field within the form.

Could I create a macro to accomplish this? Any help or suggestions on how
to are greatly appreciated.

Regards,
Scott

  #3  
Old June 19th, 2009, 04:00 PM posted to microsoft.public.access.tablesdbdesign
Golfinray
external usenet poster
 
Posts: 1,597
Default Hard-coded date in an Access Form

Put a new field in your table called Last_updated. Then in the events
properties of the textbox where date is, go to the onclick event and add this
code:
Me.Last_updated=Now()
--
Milton Purdy
ACCESS
State of Arkansas


"millerwms" wrote:

Good morning,

I have created a form for our field reps which they will be completing to
escalate an employee issue. One field I have in my bound table is "Date
Submitted". Instead of leaving this open and up to the rep to fill in (and
possibly back date!), I would like to hard-code for "today" to drop right
into that field within the form.

Could I create a macro to accomplish this? Any help or suggestions on how
to are greatly appreciated.

Regards,
Scott

  #4  
Old June 19th, 2009, 04:06 PM posted to microsoft.public.access.tablesdbdesign
millerwms
external usenet poster
 
Posts: 6
Default Hard-coded date in an Access Form

Thank you Mr. Purdy,

You actually bring up a good point for me to add a separate field to capture
updated date, though I would still like to capture separately submit date.

Prior to seeing these responses, I found the answer on how to add default
dates.

I appreciate the quick responses!

Regards,
Scott

"golfinray" wrote:

Put a new field in your table called Last_updated. Then in the events
properties of the textbox where date is, go to the onclick event and add this
code:
Me.Last_updated=Now()
--
Milton Purdy
ACCESS
State of Arkansas


"millerwms" wrote:

Good morning,

I have created a form for our field reps which they will be completing to
escalate an employee issue. One field I have in my bound table is "Date
Submitted". Instead of leaving this open and up to the rep to fill in (and
possibly back date!), I would like to hard-code for "today" to drop right
into that field within the form.

Could I create a macro to accomplish this? Any help or suggestions on how
to are greatly appreciated.

Regards,
Scott

  #5  
Old June 19th, 2009, 04:16 PM posted to microsoft.public.access.tablesdbdesign
millerwms
external usenet poster
 
Posts: 6
Default Hard-coded date in an Access Form

Mr. Bailey,

I have set this up in my general properties, but on my form it is kicking
back a date of 12/30/1899. I thought this might be due to the dates within
my machine, but when I use the "today" radio button within the date picker,
the proper date populates.

Any suggestions?

Thanks in advance!
Scott

"Beetle" wrote:

No macro or code necessary. Set the default value to;

Date()

which will return the current date.

--
_________

Sean Bailey


"millerwms" wrote:

Good morning,

I have created a form for our field reps which they will be completing to
escalate an employee issue. One field I have in my bound table is "Date
Submitted". Instead of leaving this open and up to the rep to fill in (and
possibly back date!), I would like to hard-code for "today" to drop right
into that field within the form.

Could I create a macro to accomplish this? Any help or suggestions on how
to are greatly appreciated.

Regards,
Scott

  #6  
Old June 19th, 2009, 04:23 PM posted to microsoft.public.access.tablesdbdesign
millerwms
external usenet poster
 
Posts: 6
Default Hard-coded date in an Access Form

I am having trouble locating events properties. Do you mean within field
properties? I am using date/time data type.

I am sure these are simple questions, and appreciate your feedback and
patience.

Scott

"golfinray" wrote:

Put a new field in your table called Last_updated. Then in the events
properties of the textbox where date is, go to the onclick event and add this
code:
Me.Last_updated=Now()
--
Milton Purdy
ACCESS
State of Arkansas


"millerwms" wrote:

Good morning,

I have created a form for our field reps which they will be completing to
escalate an employee issue. One field I have in my bound table is "Date
Submitted". Instead of leaving this open and up to the rep to fill in (and
possibly back date!), I would like to hard-code for "today" to drop right
into that field within the form.

Could I create a macro to accomplish this? Any help or suggestions on how
to are greatly appreciated.

Regards,
Scott

  #7  
Old June 19th, 2009, 04:35 PM posted to microsoft.public.access.tablesdbdesign
millerwms
external usenet poster
 
Posts: 6
Default Hard-coded date in an Access Form

Nevermind, I figured it out - my value was redundant. Thank you!

"millerwms" wrote:

Mr. Bailey,

I have set this up in my general properties, but on my form it is kicking
back a date of 12/30/1899. I thought this might be due to the dates within
my machine, but when I use the "today" radio button within the date picker,
the proper date populates.

Any suggestions?

Thanks in advance!
Scott

"Beetle" wrote:

No macro or code necessary. Set the default value to;

Date()

which will return the current date.

--
_________

Sean Bailey


"millerwms" wrote:

Good morning,

I have created a form for our field reps which they will be completing to
escalate an employee issue. One field I have in my bound table is "Date
Submitted". Instead of leaving this open and up to the rep to fill in (and
possibly back date!), I would like to hard-code for "today" to drop right
into that field within the form.

Could I create a macro to accomplish this? Any help or suggestions on how
to are greatly appreciated.

Regards,
Scott

  #8  
Old June 19th, 2009, 07:08 PM posted to microsoft.public.access.tablesdbdesign
millerwms
external usenet poster
 
Posts: 6
Default Hard-coded date in an Access Form

Hello,

I was able to enter the code listed below in the events properties in my
form design view, but received the following message when confirming in form
view:

"The expression On Click you entered as the event property setting produced
the collowing error: The object doesn't contain the Automation object "Me.".

Any ideas?

Thanks Again,
Scott

"golfinray" wrote:

Put a new field in your table called Last_updated. Then in the events
properties of the textbox where date is, go to the onclick event and add this
code:
Me.Last_updated=Now()
--
Milton Purdy
ACCESS
State of Arkansas


"millerwms" wrote:

Good morning,

I have created a form for our field reps which they will be completing to
escalate an employee issue. One field I have in my bound table is "Date
Submitted". Instead of leaving this open and up to the rep to fill in (and
possibly back date!), I would like to hard-code for "today" to drop right
into that field within the form.

Could I create a macro to accomplish this? Any help or suggestions on how
to are greatly appreciated.

Regards,
Scott

  #9  
Old June 19th, 2009, 07:48 PM posted to microsoft.public.access.tablesdbdesign
Beetle
external usenet poster
 
Posts: 1,254
Default Hard-coded date in an Access Form

Let's take a step back here. Have you now decided to add another
field to your table to track every time the record is modified?

If so, the On Click event of the Date Submitted text box is the
WRONG event to be doing this in. You would want to use the
Before Update event of the form.

Also, I'm guessing that you're attemptimg to just put
that line directly in the properies of the control, which won't
work. You would need to open the code window and put it
there.

Why don't you post back and let us know exactly what it is that
you want to happen, and we can give you more advice.

--
_________

Sean Bailey


"millerwms" wrote:

Hello,

I was able to enter the code listed below in the events properties in my
form design view, but received the following message when confirming in form
view:

"The expression On Click you entered as the event property setting produced
the collowing error: The object doesn't contain the Automation object "Me.".

Any ideas?

Thanks Again,
Scott

"golfinray" wrote:

Put a new field in your table called Last_updated. Then in the events
properties of the textbox where date is, go to the onclick event and add this
code:
Me.Last_updated=Now()
--
Milton Purdy
ACCESS
State of Arkansas


"millerwms" wrote:

Good morning,

I have created a form for our field reps which they will be completing to
escalate an employee issue. One field I have in my bound table is "Date
Submitted". Instead of leaving this open and up to the rep to fill in (and
possibly back date!), I would like to hard-code for "today" to drop right
into that field within the form.

Could I create a macro to accomplish this? Any help or suggestions on how
to are greatly appreciated.

Regards,
Scott

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.