Hi, everyone
I'm building an Access DB system using VBA. I have a ActiveX DTPicker so the user can select a date. This date is put in another textbox that is bound to a table. I do this because if I make the DTPicker bound to the table then the date keeps changing to the current date (or the date that was last selected) when I scroll through the records on the form. I just made the DTPicker so small that only the dropdown arrow is visible and put it right next to the bound textbox. The event that I use in DTPicker to write the value to the textbox is "On Lost Focus" like this:
This works fine but I want the textbox to show the new date as soon as the user selects it, not when the DTPicker looses focus. I don't know how to do it because DTPicker only has these events; On updated, On Enter, On Exit, On Got Focus and On Lost Focus. It seems to me I will need somthing like On Change event.
I've really been pulling my hair over this so hopfully someone has a solution to this problem.
I'm building an Access DB system using VBA. I have a ActiveX DTPicker so the user can select a date. This date is put in another textbox that is bound to a table. I do this because if I make the DTPicker bound to the table then the date keeps changing to the current date (or the date that was last selected) when I scroll through the records on the form. I just made the DTPicker so small that only the dropdown arrow is visible and put it right next to the bound textbox. The event that I use in DTPicker to write the value to the textbox is "On Lost Focus" like this:
Code:
Private Sub DTPicker9_LostFocus()
Dim pos As Integer
pos = InStr(DTPicker9.Value, " ")
Me.txtbox = Left(DTPicker9.Value, pos)
End Sub
I've really been pulling my hair over this so hopfully someone has a solution to this problem.
Comment