ActiveX Cal Problem

Ice Rhino

Registered User.
Local time
Today, 02:37
Joined
Jun 30, 2000
Messages
210
I have just tried to reuse a peice of code that I have used in several databases before and for some reason it is not working. Could someone have a glance over what follows to see what I have done wrong

Option Compare Database
Option Explicit
Dim WhichBox As Integer

Private Sub Atx_Cal_Click()
If WhichBox = 1 Then
txt_StaDat = atx_Cal.Value
End If
If WhichBox = 2 Then
txt_EndDat = atx_Cal.Value
End If
End Sub

Private Sub txt_StaDat_Enter()
WhichBox = 1
End Sub

Private Sub txt_EndDat_Enter()
WhichBox = 2
End Sub

What should happen is that if txt_StaDat has the focus, then when the user selects a value on the Calendar, then the value selected is placed in the txt box, But for some reason, probably a totally stupid oversight on my part, as soon as you click on the calendar, it gets focus and no value is put inthe txt box. On the other systems I use this method on, the calendar does not get focus, although it is not locked etc. I guess it must be a stupid setting I have missed somewhere

Regards
 
Have a look in the sample databases forum for my pop-up calendar example - you may find it more appropriate for what you are trying to do.
 
on my way there right now

Thanks
 
I found what was wrong, I put a code break in the enter() part of the txt box and when I entered the box it was not breaking, hence therefore I guess why the code was not working.

I changed this for _Enter() to _GotFocus() and now all is well. Don't know why it works on the others and not this, although this DB has been written from scratch in 2k3 Access and not coming up from 2K version

Dunno, guessing really

Out of curiosity, all my DB show as running in 2000 File Format, how do I get one to run in 2003 format, or is there no benefit to doing this?

Regards
 

Users who are viewing this thread

Back
Top Bottom