dbTalk Databases Forums  

populate now() on click

comp.databases.ms-access comp.databases.ms-access


Discuss populate now() on click in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joe Smith
 
Posts: n/a

Default populate now() on click - 10-27-2010 , 09:59 AM






I've been trying to get a field (filter_start) on a form to populate
the current date & time when that field is clicked on. I went under
form design, and on the field's (filter_start) click event I wrote in
"=Now()". However, this doesn't seem to work. Any ideas why not? And
any suggestions to get this to work? Thanks in advance.

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: populate now() on click - 10-27-2010 , 10:06 AM






Joe Smith wrote:
Quote:
I've been trying to get a field (filter_start) on a form to populate
the current date & time when that field is clicked on. I went under
form design, and on the field's (filter_start) click event I wrote in
"=Now()". However, this doesn't seem to work. Any ideas why not? And
any suggestions to get this to work? Thanks in advance.
Me.Filter_Start = Now()

Reply With Quote
  #3  
Old   
Joe Smith
 
Posts: n/a

Default Re: populate now() on click - 10-27-2010 , 10:42 AM



On Oct 27, 11:06*am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Quote:
Joe Smith wrote:
I've been trying to get a field (filter_start) on a form to populate
the current date & time when that field is clicked on. I went under
form design, and on the field's (filter_start) click event I wrote in
"=Now()". However, this doesn't seem to work. Any ideas why not? And
any suggestions to get this to work? Thanks in advance.

Me.Filter_Start = Now()
I typed it in just like that but it doesn't work.

Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: populate now() on click - 10-27-2010 , 11:10 AM



Joe Smith wrote:

Quote:
On Oct 27, 11:06 am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Joe Smith wrote:

I've been trying to get a field (filter_start) on a form to populate
the current date & time when that field is clicked on. I went under
form design, and on the field's (filter_start) click event I wrote in
"=Now()". However, this doesn't seem to work. Any ideas why not? And
any suggestions to get this to work? Thanks in advance.

Me.Filter_Start = Now()


I typed it in just like that but it doesn't work.
Is Filter_Start both ControlSource and Name? If unbound it would not
need a control source. What is the error number and message?

Reply With Quote
  #5  
Old   
Joe Smith
 
Posts: n/a

Default Re: populate now() on click - 10-27-2010 , 11:28 AM



On Oct 27, 12:10*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Quote:
Joe Smith wrote:
On Oct 27, 11:06 am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Joe Smith wrote:

I've been trying to get a field (filter_start) on a form to populate
the current date & time when that field is clicked on. I went under
form design, and on the field's (filter_start) click event I wrote in
"=Now()". However, this doesn't seem to work. Any ideas why not? And
any suggestions to get this to work? Thanks in advance.

Me.Filter_Start = Now()

I typed it in just like that but it doesn't work.

Is Filter_Start both ControlSource and Name? * If unbound it would not
need a control source. *What is the error number and message?
Yes, Filter_Start is both Control Source and Name. The error is
"Microsoft Access can't find the object 'Me.'"

Reply With Quote
  #6  
Old   
Salad
 
Posts: n/a

Default Re: populate now() on click - 10-27-2010 , 11:42 AM



Joe Smith wrote:

Quote:
On Oct 27, 12:10 pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Joe Smith wrote:

On Oct 27, 11:06 am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Joe Smith wrote:

I've been trying to get a field (filter_start) on a form to populate
the current date & time when that field is clicked on. I went under
form design, and on the field's (filter_start) click event I wrote in
"=Now()". However, this doesn't seem to work. Any ideas why not? And
any suggestions to get this to work? Thanks in advance.

Me.Filter_Start = Now()

I typed it in just like that but it doesn't work.

Is Filter_Start both ControlSource and Name? If unbound it would not
need a control source. What is the error number and message?


Yes, Filter_Start is both Control Source and Name. The error is
"Microsoft Access can't find the object 'Me.'"
There's the code behind the form and a code module under modules tab.
If under Modules, there is no Me, behind the form there is.

Create a new form in design view. Open up the property sheet for the
form, select Events, select any event, hit the ... on the right and
select code. Enter the word "Me." (no quotes). You should get a
dropdown from intellisense of available properties.

Go back to the form in question. If you don't get a intellisense
dropdown when you enter Me. in your form, you have another error
someplace else. Compile it an find the other errors.

In a worse case scenario you can enter
Forms!YourFormName!Filter_Start = Now()
instead of Me.

Reply With Quote
  #7  
Old   
Joe Smith
 
Posts: n/a

Default Re: populate now() on click - 10-27-2010 , 12:32 PM



On Oct 27, 12:42*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Quote:
Joe Smith wrote:
On Oct 27, 12:10 pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Joe Smith wrote:

On Oct 27, 11:06 am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Joe Smith wrote:

I've been trying to get a field (filter_start) on a form to populate
the current date & time when that field is clicked on. I went under
form design, and on the field's (filter_start) click event I wrote in
"=Now()". However, this doesn't seem to work. Any ideas why not? And
any suggestions to get this to work? Thanks in advance.

Me.Filter_Start = Now()

I typed it in just like that but it doesn't work.

Is Filter_Start both ControlSource and Name? * If unbound it would not
need a control source. *What is the error number and message?

Yes, Filter_Start is both Control Source and Name. The error is
"Microsoft Access can't find the object 'Me.'"

There's the code behind the form and a code module under modules tab.
If under Modules, there is no Me, behind the form there is.

Create a new form in design view. *Open up the property sheet for the
form, select Events, select any event, hit the ... on the right and
select code. *Enter the word "Me." (no quotes). *You should get a
dropdown from intellisense of available properties.

Go back to the form in question. *If you don't get a intellisense
dropdown when you enter Me. in your form, you have another error
someplace else. *Compile it an find the other errors.

In a worse case scenario you can enter
* * * * Forms!YourFormName!Filter_Start = Now()
instead of Me.- Hide quoted text -

- Show quoted text -
Thanks. I think you put me on the right track. I got a button that
when clicked displays the current time into the Filter_Start field.
However, it overwrites all records with the same time. Is there a way
to differentiate between records. Below's the button's code. Do you
know the correct syntax to make this happen: Filter_Start.PK, so that
it differentiates each record.

Private Sub Command12_Click()
Me.Filter_Start = Time()
End Sub

Reply With Quote
  #8  
Old   
Joe Smith
 
Posts: n/a

Default Re: populate now() on click - 10-27-2010 , 01:04 PM



On Oct 27, 1:32*pm, Joe Smith <bucbarr... (AT) gmail (DOT) com> wrote:
Quote:
On Oct 27, 12:42*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:





Joe Smith wrote:
On Oct 27, 12:10 pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Joe Smith wrote:

On Oct 27, 11:06 am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Joe Smith wrote:

I've been trying to get a field (filter_start) on a form to populate
the current date & time when that field is clicked on. I went under
form design, and on the field's (filter_start) click event I wrotein
"=Now()". However, this doesn't seem to work. Any ideas why not?And
any suggestions to get this to work? Thanks in advance.

Me.Filter_Start = Now()

I typed it in just like that but it doesn't work.

Is Filter_Start both ControlSource and Name? * If unbound it would not
need a control source. *What is the error number and message?

Yes, Filter_Start is both Control Source and Name. The error is
"Microsoft Access can't find the object 'Me.'"

There's the code behind the form and a code module under modules tab.
If under Modules, there is no Me, behind the form there is.

Create a new form in design view. *Open up the property sheet for the
form, select Events, select any event, hit the ... on the right and
select code. *Enter the word "Me." (no quotes). *You should get a
dropdown from intellisense of available properties.

Go back to the form in question. *If you don't get a intellisense
dropdown when you enter Me. in your form, you have another error
someplace else. *Compile it an find the other errors.

In a worse case scenario you can enter
* * * * Forms!YourFormName!Filter_Start = Now()
instead of Me.- Hide quoted text -

- Show quoted text -

Thanks. I think you put me on the right track. I got a button that
when clicked displays the current time into the Filter_Start field.
However, it overwrites all records with the same time. Is there a way
to differentiate between records. Below's the button's code. Do you
know the correct syntax to make this happen: Filter_Start.PK, so that
it differentiates each record.

Private Sub Command12_Click()
Me.Filter_Start = Time()
End Sub- Hide quoted text -

- Show quoted text -
Nevermind. I got it. Thanks a lot for your help.

Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.