Date Picker issue

  • Thread starter Hugh self taught
  • Start date
H

Hugh self taught

Greets to the intelligent among us......

Hi All, I have an anomaly happening with the (date picker??)

I load a form to edit a record in History table using among other code, the
lines
Me.txtFromDate = Me.cboHistEditLookup.Column(4)
Me.txtToDate = Me.cboHistEditLookup.Column(5)

Then "On Click" to run my update SQL I first do the following check
If Me.txtFromDate.Value > Me.txtToDate.Value Then
MsgBox " The Ending Date Cannot be Before the Starting Date "
Me.txtToDate.SetFocus
Exit Sub
End If

However If when the form opens I click on the txtFromdate & use the date
picker to select a new date then click my update button, the date gets
updated in the table correctly but the date comparison check does not
trigger.

If I follow the identical route but changed the date value in the txtToDate
box using the date picker, it does trigger the check.

If I keyboard type values into either box then the check line triggers..!!

Any ideas or suggestions why that would be or what I could do to prevent it
from not triggering?
 
N

NuBie via AccessMonster.com

Maybe your datepicker returns both date and time, and at the same time you're
comparing DateTime Value vs Date?


MsgBox txtFromDate ' Date only
Me.txtToDate ' Date only

MsgBox DTPicker3 'Reruns Date and Time
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top