Access World Forums

Access World Forums (https://www.access-programmers.co.uk/forums/index.php)
-   Forms (https://www.access-programmers.co.uk/forums/forumdisplay.php?f=9)
-   -   Enter date after use of tab (https://www.access-programmers.co.uk/forums/showthread.php?t=306824)

access2010 09-13-2019 10:33 AM

Enter date after use of tab
 
1 Attachment(s)
Can I please have a suggestion on how to have
=To-Days date= placed into the =Target_Date= field after the =Target_$= has been manually entered and the tab moves to the =Target_Date= field

Thank you,
Nicole

theDBguy 09-13-2019 10:37 AM

Re: Enter date after use of tab
 
Hi Nicole. For example, in the AfterUpdate event of the Targe_$ control, you could try something like:
Code:

Me.TargetDate=Date()
Hope it helps...

arnelgp 09-13-2019 10:42 AM

Re: Enter date after use of tab
 
also possible on Target_$, BeforeUpdate() event.

access2010 09-13-2019 01:45 PM

Re: Enter date after use of tab
 
Thank you for your suggestions, which I have tried without success.

Your code is entered as
Me.TargetDate=Date()

and then it is automatically changed to
Me.TargetDate = Date
Note space before and after =

Could you please let me know, what I have done wrong?

Thank you,
Nicole

theDBguy 09-13-2019 02:09 PM

Re: Enter date after use of tab
 
Quote:

Originally Posted by access2010 (Post 1640074)
Thank you for your suggestions, which I have tried without success.

Your code is entered as
Me.TargetDate=Date()

and then it is automatically changed to
Me.TargetDate = Date
Note space before and after =

Could you please let me know, what I have done wrong?

Thank you,
Nicole

Hi Nicole. How exactly did you enter the code and what exactly happened? Did you go to the AfterUpdate event of the control and then selected [Event Procedure] from the dropdown and then clicked the ellipsis next to it and then entered the code inside the code stub?

Pat Hartman 09-13-2019 04:51 PM

Re: Enter date after use of tab
 
Are you saying that TargetDate didn't get populated or you are confused because Access changed your code.

Access' "correction" is correct.

Me.TargetDate = Date ---- is correct.

access2010 09-13-2019 06:20 PM

Re: Enter date after use of tab
 
Thank you, Pat.
I now now why the information in the code changed.

===
I have tried the update in the price field and date fields, using theDBguy's code and arnelgp code

In the = price field = after update
and in the = date field = before update

In both cases I receive this message
= Compile Error - Method or date member not found.

===
Crystal

arnelgp 09-14-2019 01:07 AM

Re: Enter date after use of tab
 
on vba, Compile your code and you will see the error. fix it first.

access2010 09-17-2019 09:18 AM

Re: Enter date after use of tab
 
theDBguy
Pat Hartman
arnelgp

Thank you for your assistance of using the code = Me.TargetDate=Date()
BUT, I just realized the I should have used = Me.Target_Date=Date() = which was the fields name.

Nicole

theDBguy 09-17-2019 09:19 AM

Re: Enter date after use of tab
 
Quote:

Originally Posted by access2010 (Post 1640527)
theDBguy
Pat Hartman
arnelgp

Thank you for your assistance of using the code = Me.TargetDate=Date()
BUT, I just realized the I should have used = Me.Target_Date=Date() = which was the fields name.

Nicole

Hi Nicole. Congratulations! Glad to hear you got it to work. Good luck with your project.

Pat Hartman 09-17-2019 09:35 AM

Re: Enter date after use of tab
 
When you use "Me.", you should be getting intellisense to help you finish without typing. This gives you a clue that you are making a typo. Also, if you use CamelCase and type camelcase, when you finish the word, Access capitalizes the letters to match the name's definition which is another visual clue that you have created a typo.


All times are GMT -8. The time now is 04:07 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World