PC Review


Reply
Thread Tools Rate Thread

auto display calculations based on date entered

 
 
laavista
Guest
Posts: n/a
 
      25th Apr 2009
I have a field called "CheckInDate" (short date). The user will enter a date
in the field, then based on that date, a series of calculations are done and
displayed.
I would like the calculations to automatically calculate as soon as the date
is entered (versus having the user press a command button). I used the "on
change event" and it works well if you select a date from the calendar. When
you try to enter a date manually, as soon as you type the first number, I get
an error (not right format for the field). I think it triggerse the "on
change" as soon as I enter that first number.
- Is there anyway around this?
- Is there a way of capturing that the date is being manually entered and
calling
another procedure? or
- Is there a different event I could use instead of "on change"? (I could
not get this to work except with on change unless I'm doing something wrong)

Any help would be greatly appreciated!


 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      25th Apr 2009
Use the AfterUpdate event of the control.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"laavista" <(E-Mail Removed)> wrote in message
news:2381754C-546D-4227-AC0F-(E-Mail Removed)...
>I have a field called "CheckInDate" (short date). The user will enter a
>date
> in the field, then based on that date, a series of calculations are done
> and
> displayed.
> I would like the calculations to automatically calculate as soon as the
> date
> is entered (versus having the user press a command button). I used the
> "on
> change event" and it works well if you select a date from the calendar.
> When
> you try to enter a date manually, as soon as you type the first number, I
> get
> an error (not right format for the field). I think it triggerse the "on
> change" as soon as I enter that first number.
> - Is there anyway around this?
> - Is there a way of capturing that the date is being manually entered and
> calling
> another procedure? or
> - Is there a different event I could use instead of "on change"? (I
> could
> not get this to work except with on change unless I'm doing something
> wrong)
>
> Any help would be greatly appreciated!
>
>


 
Reply With Quote
 
laavista
Guest
Posts: n/a
 
      25th Apr 2009
I've tried the AfterUpdate event, but I only have the one field on the form
-- the date they enter. The rest of the fields are unbound text boxes with
the calculations. I can't move off the field to trigger the AfterUpdate.

The "on change" works well as long as you use the calendar to pick.

Thanks for responding, though.
Any other suggestions?

Also--I want to thank you for sharing your tips and techniques. Your
website has been a great resource for me. The code you created and shared
that changes a query SQL statement into a string that can be used in VBA has
been a life saver. THANK YOU.

"Allen Browne" wrote:

> Use the AfterUpdate event of the control.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
> "laavista" <(E-Mail Removed)> wrote in message
> news:2381754C-546D-4227-AC0F-(E-Mail Removed)...
> >I have a field called "CheckInDate" (short date). The user will enter a
> >date
> > in the field, then based on that date, a series of calculations are done
> > and
> > displayed.
> > I would like the calculations to automatically calculate as soon as the
> > date
> > is entered (versus having the user press a command button). I used the
> > "on
> > change event" and it works well if you select a date from the calendar.
> > When
> > you try to enter a date manually, as soon as you type the first number, I
> > get
> > an error (not right format for the field). I think it triggerse the "on
> > change" as soon as I enter that first number.
> > - Is there anyway around this?
> > - Is there a way of capturing that the date is being manually entered and
> > calling
> > another procedure? or
> > - Is there a different event I could use instead of "on change"? (I
> > could
> > not get this to work except with on change unless I'm doing something
> > wrong)
> >
> > Any help would be greatly appreciated!
> >
> >

>
>

 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      25th Apr 2009
Hmm: I think you're going to have problems with this.

How about adding another unbound box that can take focus.
Make it very small if you wish (e.g. width = 0.01").
In it's Enter event, put the user back in the other box, e.g.:
Me.Text0.SetFocus

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"laavista" <(E-Mail Removed)> wrote in message
news:AFBE9CF4-CCFC-4DEE-9E5D-(E-Mail Removed)...
> I've tried the AfterUpdate event, but I only have the one field on the
> form
> -- the date they enter. The rest of the fields are unbound text boxes
> with
> the calculations. I can't move off the field to trigger the AfterUpdate.
>
> The "on change" works well as long as you use the calendar to pick.
>
> Thanks for responding, though.
> Any other suggestions?
>
> Also--I want to thank you for sharing your tips and techniques. Your
> website has been a great resource for me. The code you created and shared
> that changes a query SQL statement into a string that can be used in VBA
> has
> been a life saver. THANK YOU.
>
> "Allen Browne" wrote:
>
>> Use the AfterUpdate event of the control.
>>
>> "laavista" <(E-Mail Removed)> wrote in message
>> news:2381754C-546D-4227-AC0F-(E-Mail Removed)...
>> >I have a field called "CheckInDate" (short date). The user will enter a
>> >date
>> > in the field, then based on that date, a series of calculations are
>> > done
>> > and
>> > displayed.
>> > I would like the calculations to automatically calculate as soon as the
>> > date
>> > is entered (versus having the user press a command button). I used the
>> > "on
>> > change event" and it works well if you select a date from the calendar.
>> > When
>> > you try to enter a date manually, as soon as you type the first number,
>> > I
>> > get
>> > an error (not right format for the field). I think it triggerse the
>> > "on
>> > change" as soon as I enter that first number.
>> > - Is there anyway around this?
>> > - Is there a way of capturing that the date is being manually entered
>> > and
>> > calling
>> > another procedure? or
>> > - Is there a different event I could use instead of "on change"? (I
>> > could
>> > not get this to work except with on change unless I'm doing something
>> > wrong)
>> >
>> > Any help would be greatly appreciated!
>> >
>> >

>>
>>


 
Reply With Quote
 
laavista
Guest
Posts: n/a
 
      25th Apr 2009
I'll do something like that if I can't figure out anything else. Selecting
from the calendar works so slick that I'd really like to have it work when
the user enters their own date.

Thanks for your help!!



"Allen Browne" wrote:

> Hmm: I think you're going to have problems with this.
>
> How about adding another unbound box that can take focus.
> Make it very small if you wish (e.g. width = 0.01").
> In it's Enter event, put the user back in the other box, e.g.:
> Me.Text0.SetFocus
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "laavista" <(E-Mail Removed)> wrote in message
> news:AFBE9CF4-CCFC-4DEE-9E5D-(E-Mail Removed)...
> > I've tried the AfterUpdate event, but I only have the one field on the
> > form
> > -- the date they enter. The rest of the fields are unbound text boxes
> > with
> > the calculations. I can't move off the field to trigger the AfterUpdate.
> >
> > The "on change" works well as long as you use the calendar to pick.
> >
> > Thanks for responding, though.
> > Any other suggestions?
> >
> > Also--I want to thank you for sharing your tips and techniques. Your
> > website has been a great resource for me. The code you created and shared
> > that changes a query SQL statement into a string that can be used in VBA
> > has
> > been a life saver. THANK YOU.
> >
> > "Allen Browne" wrote:
> >
> >> Use the AfterUpdate event of the control.
> >>
> >> "laavista" <(E-Mail Removed)> wrote in message
> >> news:2381754C-546D-4227-AC0F-(E-Mail Removed)...
> >> >I have a field called "CheckInDate" (short date). The user will enter a
> >> >date
> >> > in the field, then based on that date, a series of calculations are
> >> > done
> >> > and
> >> > displayed.
> >> > I would like the calculations to automatically calculate as soon as the
> >> > date
> >> > is entered (versus having the user press a command button). I used the
> >> > "on
> >> > change event" and it works well if you select a date from the calendar.
> >> > When
> >> > you try to enter a date manually, as soon as you type the first number,
> >> > I
> >> > get
> >> > an error (not right format for the field). I think it triggerse the
> >> > "on
> >> > change" as soon as I enter that first number.
> >> > - Is there anyway around this?
> >> > - Is there a way of capturing that the date is being manually entered
> >> > and
> >> > calling
> >> > another procedure? or
> >> > - Is there a different event I could use instead of "on change"? (I
> >> > could
> >> > not get this to work except with on change unless I'm doing something
> >> > wrong)
> >> >
> >> > Any help would be greatly appreciated!
> >> >
> >> >
> >>
> >>

>
>

 
Reply With Quote
 
asus
Guest
Posts: n/a
 
      25th Apr 2009

"laavista" <(E-Mail Removed)>, iletisinde şunu yazdı,
news:736B3262-CD73-4954-A952-(E-Mail Removed)...
> I'll do something like that if I can't figure out anything else.
> Selecting
> from the calendar works so slick that I'd really like to have it work when
> the user enters their own date.
>
> Thanks for your help!!
>
>
>
> "Allen Browne" wrote:
>
>> Hmm: I think you're going to have problems with this.
>>
>> How about adding another unbound box that can take focus.
>> Make it very small if you wish (e.g. width = 0.01").
>> In it's Enter event, put the user back in the other box, e.g.:
>> Me.Text0.SetFocus
>>
>> --
>> Allen Browne - Microsoft MVP. Perth, Western Australia
>> Tips for Access users - http://allenbrowne.com/tips.html
>> Reply to group, rather than allenbrowne at mvps dot org.
>>
>> "laavista" <(E-Mail Removed)> wrote in message
>> news:AFBE9CF4-CCFC-4DEE-9E5D-(E-Mail Removed)...
>> > I've tried the AfterUpdate event, but I only have the one field on the
>> > form
>> > -- the date they enter. The rest of the fields are unbound text boxes
>> > with
>> > the calculations. I can't move off the field to trigger the
>> > AfterUpdate.
>> >
>> > The "on change" works well as long as you use the calendar to pick.
>> >
>> > Thanks for responding, though.
>> > Any other suggestions?
>> >
>> > Also--I want to thank you for sharing your tips and techniques. Your
>> > website has been a great resource for me. The code you created and
>> > shared
>> > that changes a query SQL statement into a string that can be used in
>> > VBA
>> > has
>> > been a life saver. THANK YOU.
>> >
>> > "Allen Browne" wrote:
>> >
>> >> Use the AfterUpdate event of the control.
>> >>
>> >> "laavista" <(E-Mail Removed)> wrote in message
>> >> news:2381754C-546D-4227-AC0F-(E-Mail Removed)...
>> >> >I have a field called "CheckInDate" (short date). The user will
>> >> >enter a
>> >> >date
>> >> > in the field, then based on that date, a series of calculations are
>> >> > done
>> >> > and
>> >> > displayed.
>> >> > I would like the calculations to automatically calculate as soon as
>> >> > the
>> >> > date
>> >> > is entered (versus having the user press a command button). I used
>> >> > the
>> >> > "on
>> >> > change event" and it works well if you select a date from the
>> >> > calendar.
>> >> > When
>> >> > you try to enter a date manually, as soon as you type the first
>> >> > number,
>> >> > I
>> >> > get
>> >> > an error (not right format for the field). I think it triggerse
>> >> > the
>> >> > "on
>> >> > change" as soon as I enter that first number.
>> >> > - Is there anyway around this?
>> >> > - Is there a way of capturing that the date is being manually
>> >> > entered
>> >> > and
>> >> > calling
>> >> > another procedure? or
>> >> > - Is there a different event I could use instead of "on change"?
>> >> > (I
>> >> > could
>> >> > not get this to work except with on change unless I'm doing
>> >> > something
>> >> > wrong)
>> >> >
>> >> > Any help would be greatly appreciated!
>> >> >
>> >> >
>> >>
>> >>

>>
>>


 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      25th Apr 2009
My experience is that hitting Enter causes the AfterUpdate event to fire.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"laavista" <(E-Mail Removed)> wrote in message
news:736B3262-CD73-4954-A952-(E-Mail Removed)...
> I'll do something like that if I can't figure out anything else.
> Selecting
> from the calendar works so slick that I'd really like to have it work when
> the user enters their own date.
>
> Thanks for your help!!
>
>
>
> "Allen Browne" wrote:
>
>> Hmm: I think you're going to have problems with this.
>>
>> How about adding another unbound box that can take focus.
>> Make it very small if you wish (e.g. width = 0.01").
>> In it's Enter event, put the user back in the other box, e.g.:
>> Me.Text0.SetFocus
>>
>> --
>> Allen Browne - Microsoft MVP. Perth, Western Australia
>> Tips for Access users - http://allenbrowne.com/tips.html
>> Reply to group, rather than allenbrowne at mvps dot org.
>>
>> "laavista" <(E-Mail Removed)> wrote in message
>> news:AFBE9CF4-CCFC-4DEE-9E5D-(E-Mail Removed)...
>> > I've tried the AfterUpdate event, but I only have the one field on the
>> > form
>> > -- the date they enter. The rest of the fields are unbound text boxes
>> > with
>> > the calculations. I can't move off the field to trigger the
>> > AfterUpdate.
>> >
>> > The "on change" works well as long as you use the calendar to pick.
>> >
>> > Thanks for responding, though.
>> > Any other suggestions?
>> >
>> > Also--I want to thank you for sharing your tips and techniques. Your
>> > website has been a great resource for me. The code you created and
>> > shared
>> > that changes a query SQL statement into a string that can be used in
>> > VBA
>> > has
>> > been a life saver. THANK YOU.
>> >
>> > "Allen Browne" wrote:
>> >
>> >> Use the AfterUpdate event of the control.
>> >>
>> >> "laavista" <(E-Mail Removed)> wrote in message
>> >> news:2381754C-546D-4227-AC0F-(E-Mail Removed)...
>> >> >I have a field called "CheckInDate" (short date). The user will
>> >> >enter a
>> >> >date
>> >> > in the field, then based on that date, a series of calculations are
>> >> > done
>> >> > and
>> >> > displayed.
>> >> > I would like the calculations to automatically calculate as soon as
>> >> > the
>> >> > date
>> >> > is entered (versus having the user press a command button). I used
>> >> > the
>> >> > "on
>> >> > change event" and it works well if you select a date from the
>> >> > calendar.
>> >> > When
>> >> > you try to enter a date manually, as soon as you type the first
>> >> > number,
>> >> > I
>> >> > get
>> >> > an error (not right format for the field). I think it triggerse
>> >> > the
>> >> > "on
>> >> > change" as soon as I enter that first number.
>> >> > - Is there anyway around this?
>> >> > - Is there a way of capturing that the date is being manually
>> >> > entered
>> >> > and
>> >> > calling
>> >> > another procedure? or
>> >> > - Is there a different event I could use instead of "on change"?
>> >> > (I
>> >> > could
>> >> > not get this to work except with on change unless I'm doing
>> >> > something
>> >> > wrong)
>> >> >
>> >> > Any help would be greatly appreciated!
>> >> >
>> >> >
>> >>
>> >>

>>
>>



 
Reply With Quote
 
laavista
Guest
Posts: n/a
 
      25th Apr 2009
Thanks everyone!

"raskew via AccessMonster.com" wrote:

> I concur with Doug's evaluation. To test, I created a form
> with just one textbox/label. Default of the textbox is Date()
> Also added was a label, with Visible set to false.
>
> In the after update evfent of the text box:
>
> Private Sub Text0_AfterUpdate()
> Me.Label3.Visible = True
> Me.Label3.Caption = "Your input = " & Format(Me.Text0, "long date")
> End Sub
>
> Upon entering a date in Text0 and hitting Enter, it works as advertised.
>
> Bob
> Douglas J. Steele wrote:
> >My experience is that hitting Enter causes the AfterUpdate event to fire.
> >
> >> I'll do something like that if I can't figure out anything else.
> >> Selecting

> >[quoted text clipped - 70 lines]
> >>> >> >
> >>> >> > Any help would be greatly appreciated!

>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...ccess/200904/1
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get next THU date based on date entered in another cell Munchkin Microsoft Excel Worksheet Functions 1 2nd Oct 2008 11:12 PM
Dates - Need to display date one month prior to user-entered date brettopp Microsoft Excel Worksheet Functions 13 3rd Dec 2007 05:58 PM
Date Calculations before date entered =?Utf-8?B?TWEyV2Vpcg==?= Microsoft Excel Misc 8 1st Feb 2007 03:34 AM
Appointments display on date entered rather than date/time schedul =?Utf-8?B?TWF4UlBldGVyc29u?= Microsoft Outlook Calendar 0 28th Nov 2006 04:49 PM
Automatically entering a date based on a date entered =?Utf-8?B?cm9sbGVyc2thdGUwNDI5?= Microsoft Access Forms 1 29th Mar 2004 12:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:56 PM.