B
BizMark
Dear All,
I have a DialogSheet which contains a 'date chooser' screen.
It contains a grid of textboxes which, in the top row contain "Mon
Tue, Wed, Thu"... etc and in the following rows, the number
1-28/29/30/31 (depending on how many days in the month).
There are actually 31 date boxes, but the dates are put through
Format(DATE(day,month,year),"dd") function to test whether the resul
matches the supplied day. In this way if the result DOESN'T match
(i.e. for 29, 30 or 31 days in February) I set the Interior.ColorInde
to 'white' (which has the effect of hiding the number).
All that works fine and dandy.
However, each textbox has a routine set to its .OnAction property whic
sets the selected date box as a date to search for in a data sheet.
This other routine highlights the selected text box by colouring i
blue (unselected boxes are coloured black) and also converts th
selection to a date value which is returned to the dialogsheet in
textbox and used by the calling routine to determine the date to searc
for.
In Excel 95 when this DialogSheet was first created, clicking on th
textboxes worked every time. On moving to Excel 97 I found it worke
almost all the time but on occasions, the textboxes would not b
clickable or get focus - so the .OnAction event would not trigger an
the routine would not run.
On moving to Excel XP and 2003 I have found that this DialogShee
ALMOST NEVER works. However, there ARE rare occasions when it does.
I can't seem to find a pattern to this - I have tried setting the focu
to controls either side of the textboxes and/or moving through them b
tabbing - I can TAB onto the textboxes then press SPACE to invoke th
.OnAction event, but clicking on them with the mouse has no effect.
I know I really should re-create the dialog as a UserForm, but I woul
like to know whether there is some workaround or perhaps a simpl
explanation, perhaps there is a single line of code I could write int
the routine before the .Show instruction to ensure the textboxes ar
always active.
(Note - when the dialog is shown, a routine is run which checks ho
many days there are in the month, and colours the date boxe
accordingly, as described above. Also, for non-applicable dates, th
.Enabled property is set to False. However for all applicable dates
the .Enabled property is actively set back to True.)
BizMar
I have a DialogSheet which contains a 'date chooser' screen.
It contains a grid of textboxes which, in the top row contain "Mon
Tue, Wed, Thu"... etc and in the following rows, the number
1-28/29/30/31 (depending on how many days in the month).
There are actually 31 date boxes, but the dates are put through
Format(DATE(day,month,year),"dd") function to test whether the resul
matches the supplied day. In this way if the result DOESN'T match
(i.e. for 29, 30 or 31 days in February) I set the Interior.ColorInde
to 'white' (which has the effect of hiding the number).
All that works fine and dandy.
However, each textbox has a routine set to its .OnAction property whic
sets the selected date box as a date to search for in a data sheet.
This other routine highlights the selected text box by colouring i
blue (unselected boxes are coloured black) and also converts th
selection to a date value which is returned to the dialogsheet in
textbox and used by the calling routine to determine the date to searc
for.
In Excel 95 when this DialogSheet was first created, clicking on th
textboxes worked every time. On moving to Excel 97 I found it worke
almost all the time but on occasions, the textboxes would not b
clickable or get focus - so the .OnAction event would not trigger an
the routine would not run.
On moving to Excel XP and 2003 I have found that this DialogShee
ALMOST NEVER works. However, there ARE rare occasions when it does.
I can't seem to find a pattern to this - I have tried setting the focu
to controls either side of the textboxes and/or moving through them b
tabbing - I can TAB onto the textboxes then press SPACE to invoke th
.OnAction event, but clicking on them with the mouse has no effect.
I know I really should re-create the dialog as a UserForm, but I woul
like to know whether there is some workaround or perhaps a simpl
explanation, perhaps there is a single line of code I could write int
the routine before the .Show instruction to ensure the textboxes ar
always active.
(Note - when the dialog is shown, a routine is run which checks ho
many days there are in the month, and colours the date boxe
accordingly, as described above. Also, for non-applicable dates, th
.Enabled property is set to False. However for all applicable dates
the .Enabled property is actively set back to True.)
BizMar