Connecting Tech Pros Worldwide Help | Site Map

Help with double click event

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 9th, 2007, 11:25 AM
Jim Devenish
Guest
 
Posts: n/a
Default Help with double click event

I have an unbound form that displays all the days of the year as a
calendar. It has 12 rows of text boxes with either 29,30 or 31 in
each row. Text box names are of the form: display_01_01,
display_01_02 ... display_12_31.

This is used to display bookings of holiday properties and works
well. I am now wishing to be able to highlight a range of dates by
double clicking in one text box and then in another, highlighting all
the dates between these.

I am creating a double click event for each of the 366 text boxes,
although the body of each is identical in that it calls Sub which does
the work.

I am, at the moment, steadily and painstakingly creating these events.

What I am wondering is whether is a better way. Could I use the double
click event of the Form or Detail. I.e. if a text box does not have a
double click event is the click passed on to the Form?

Any ideas would be welcome. It is working for January, Februay and
March bu I still I have more than 200 events to create!!

Jim


  #2  
Old November 9th, 2007, 02:25 PM
OldPro
Guest
 
Posts: n/a
Default Re: Help with double click event

On Nov 9, 6:16 am, Jim Devenish <internet.shopp...@foobox.comwrote:
Quote:
I have an unbound form that displays all the days of the year as a
calendar. It has 12 rows of text boxes with either 29,30 or 31 in
each row. Text box names are of the form: display_01_01,
display_01_02 ... display_12_31.
>
This is used to display bookings of holiday properties and works
well. I am now wishing to be able to highlight a range of dates by
double clicking in one text box and then in another, highlighting all
the dates between these.
>
I am creating a double click event for each of the 366 text boxes,
although the body of each is identical in that it calls Sub which does
the work.
>
I am, at the moment, steadily and painstakingly creating these events.
>
What I am wondering is whether is a better way. Could I use the double
click event of the Form or Detail. I.e. if a text box does not have a
double click event is the click passed on to the Form?
>
Any ideas would be welcome. It is working for January, Februay and
March bu I still I have more than 200 events to create!!
>
Jim
It's been more than 20 minutes... my first response must be lost in
the either. You don't have to open a code window for each textbox,
just create a common function that uses the textbox number, or the
date as a parameter, and add the function to each doubleclick proptery
in each of the property windows. It would look something like this:
= HiliteDates(1)
The 1 represents the number of the textbox that was clicked. If you
put
me("textbox" & num).Value
in the function, then you can get the date. If you use the Static
keyword, you can check the last date before reading the new date, and
thus know which range to hilite.

  #3  
Old November 9th, 2007, 02:45 PM
Jim Devenish
Guest
 
Posts: n/a
Default Re: Help with double click event

On Nov 9, 3:21 pm, OldPro <rrossk...@sbcglobal.netwrote:
Quote:
On Nov 9, 6:16 am, Jim Devenish <internet.shopp...@foobox.comwrote:
>
>
>
Quote:
I have an unbound form that displays all the days of the year as a
calendar. It has 12 rows of text boxes with either 29,30 or 31 in
each row. Text box names are of the form: display_01_01,
display_01_02 ... display_12_31.
>
Quote:
This is used to display bookings of holiday properties and works
well. I am now wishing to be able to highlight a range of dates by
double clicking in one text box and then in another, highlighting all
the dates between these.
>
Quote:
I am creating a double click event for each of the 366 text boxes,
although the body of each is identical in that it calls Sub which does
the work.
>
Quote:
I am, at the moment, steadily and painstakingly creating these events.
>
Quote:
What I am wondering is whether is a better way. Could I use the double
click event of the Form or Detail. I.e. if a text box does not have a
double click event is the click passed on to the Form?
>
Quote:
Any ideas would be welcome. It is working for January, Februay and
March bu I still I have more than 200 events to create!!
>
Quote:
Jim
>
It's been more than 20 minutes... my first response must be lost in
the either. You don't have to open a code window for each textbox,
just create a common function that uses the textbox number, or the
date as a parameter, and add the function to each doubleclick proptery
in each of the property windows. It would look something like this:
= HiliteDates(1)
The 1 represents the number of the textbox that was clicked. If you
put
me("textbox" & num).Value
in the function, then you can get the date. If you use the Static
keyword, you can check the last date before reading the new date, and
thus know which range to hilite.
Great. I had forgotten (if I every realised) that I could put a
function name directly in the properties against On Dbl Click.

The really quick thing is that I can select all the text boxes in one
go and enter the function name just one. Brilliant.

Jim


  #4  
Old November 9th, 2007, 02:55 PM
Jim Devenish
Guest
 
Posts: n/a
Default Re: Help with double click event

On Nov 9, 3:42 pm, Jim Devenish <internet.shopp...@foobox.comwrote:
Quote:
On Nov 9, 3:21 pm, OldPro <rrossk...@sbcglobal.netwrote:
>
>
>
Quote:
On Nov 9, 6:16 am, Jim Devenish <internet.shopp...@foobox.comwrote:
>
Quote:
Quote:
I have an unbound form that displays all the days of the year as a
calendar. It has 12 rows of text boxes with either 29,30 or 31 in
each row. Text box names are of the form: display_01_01,
display_01_02 ... display_12_31.
>
Quote:
Quote:
This is used to display bookings of holiday properties and works
well. I am now wishing to be able to highlight a range of dates by
double clicking in one text box and then in another, highlighting all
the dates between these.
>
Quote:
Quote:
I am creating a double click event for each of the 366 text boxes,
although the body of each is identical in that it calls Sub which does
the work.
>
Quote:
Quote:
I am, at the moment, steadily and painstakingly creating these events.
>
Quote:
Quote:
What I am wondering is whether is a better way. Could I use the double
click event of the Form or Detail. I.e. if a text box does not have a
double click event is the click passed on to the Form?
>
Quote:
Quote:
Any ideas would be welcome. It is working for January, Februay and
March bu I still I have more than 200 events to create!!
>
Quote:
Quote:
Jim
>
Quote:
It's been more than 20 minutes... my first response must be lost in
the either. You don't have to open a code window for each textbox,
just create a common function that uses the textbox number, or the
date as a parameter, and add the function to each doubleclick proptery
in each of the property windows. It would look something like this:
= HiliteDates(1)
The 1 represents the number of the textbox that was clicked. If you
put
me("textbox" & num).Value
in the function, then you can get the date. If you use the Static
keyword, you can check the last date before reading the new date, and
thus know which range to hilite.
>
Great. I had forgotten (if I every realised) that I could put a
function name directly in the properties against On Dbl Click.
>
The really quick thing is that I can select all the text boxes in one
go and enter the function name just one. Brilliant.
>
Jim
As I say in my previous post, it works well. However I have notice
one oddity. When I double click the text box, the function is
entered on 3 consecutive times whereas the double click event code was
entered only once.

Strange. Not sure why this happens.

Any idea?

Jim


  #5  
Old November 9th, 2007, 03:45 PM
OldPro
Guest
 
Posts: n/a
Default Re: Help with double click event

On Nov 9, 9:54 am, Jim Devenish <internet.shopp...@foobox.comwrote:
Quote:
On Nov 9, 3:42 pm, Jim Devenish <internet.shopp...@foobox.comwrote:
>
>
>
>
>
Quote:
On Nov 9, 3:21 pm, OldPro <rrossk...@sbcglobal.netwrote:
>
Quote:
Quote:
On Nov 9, 6:16 am, Jim Devenish <internet.shopp...@foobox.comwrote:
>
Quote:
Quote:
I have an unbound form that displays all the days of the year as a
calendar. It has 12 rows of text boxes with either 29,30 or 31 in
each row. Text box names are of the form: display_01_01,
display_01_02 ... display_12_31.
>
Quote:
Quote:
This is used to display bookings of holiday properties and works
well. I am now wishing to be able to highlight a range of dates by
double clicking in one text box and then in another, highlighting all
the dates between these.
>
Quote:
Quote:
I am creating a double click event for each of the 366 text boxes,
although the body of each is identical in that it calls Sub which does
the work.
>
Quote:
Quote:
I am, at the moment, steadily and painstakingly creating these events.
>
Quote:
Quote:
What I am wondering is whether is a better way. Could I use the double
click event of the Form or Detail. I.e. if a text box does not have a
double click event is the click passed on to the Form?
>
Quote:
Quote:
Any ideas would be welcome. It is working for January, Februay and
March bu I still I have more than 200 events to create!!
>
Quote:
Quote:
Jim
>
Quote:
Quote:
It's been more than 20 minutes... my first response must be lost in
the either. You don't have to open a code window for each textbox,
just create a common function that uses the textbox number, or the
date as a parameter, and add the function to each doubleclick proptery
in each of the property windows. It would look something like this:
= HiliteDates(1)
The 1 represents the number of the textbox that was clicked. If you
put
me("textbox" & num).Value
in the function, then you can get the date. If you use the Static
keyword, you can check the last date before reading the new date, and
thus know which range to hilite.
>
Quote:
Great. I had forgotten (if I every realised) that I could put a
function name directly in the properties against On Dbl Click.
>
Quote:
The really quick thing is that I can select all the text boxes in one
go and enter the function name just one. Brilliant.
>
Quote:
Jim
>
As I say in my previous post, it works well. However I have notice
one oddity. When I double click the text box, the function is
entered on 3 consecutive times whereas the double click event code was
entered only once.
>
Strange. Not sure why this happens.
>
Any idea?
>
Jim- Hide quoted text -
>
- Show quoted text -
I tested it on my Access 97 version... it worked fine. Create a new
form and drop a single textbox on it. Put a function in the
double_click event property, and put a static counter in the function
with a msgbox that displays the counter. This is a quick and easy
test.

The only other thing that comes to mind is that you are working in a
continuous form. They have differenct rules, as there is only one
real set of controls; the rest are just reflections.

  #6  
Old November 9th, 2007, 04:35 PM
Tom van Stiphout
Guest
 
Posts: n/a
Default Re: Help with double click event

On Fri, 09 Nov 2007 04:16:12 -0800, Jim Devenish
<internet.shopping@foobox.comwrote:

No. Events don't bubble up in VBA, unlike in DotNet.

You could generate the events in code. Check out the Module object,
its CreateEventProc method, etc.

-Tom.

Quote:
>I have an unbound form that displays all the days of the year as a
>calendar. It has 12 rows of text boxes with either 29,30 or 31 in
>each row. Text box names are of the form: display_01_01,
>display_01_02 ... display_12_31.
>
>This is used to display bookings of holiday properties and works
>well. I am now wishing to be able to highlight a range of dates by
>double clicking in one text box and then in another, highlighting all
>the dates between these.
>
>I am creating a double click event for each of the 366 text boxes,
>although the body of each is identical in that it calls Sub which does
>the work.
>
>I am, at the moment, steadily and painstakingly creating these events.
>
>What I am wondering is whether is a better way. Could I use the double
>click event of the Form or Detail. I.e. if a text box does not have a
>double click event is the click passed on to the Form?
>
>Any ideas would be welcome. It is working for January, Februay and
>March bu I still I have more than 200 events to create!!
>
>Jim
  #7  
Old November 12th, 2007, 09:45 PM
OldPro
Guest
 
Posts: n/a
Default Re: Help with double click event

On Nov 9, 6:16 am, Jim Devenish <internet.shopp...@foobox.comwrote:
Quote:
I have an unbound form that displays all the days of the year as a
calendar. It has 12 rows of text boxes with either 29,30 or 31 in
each row. Text box names are of the form: display_01_01,
display_01_02 ... display_12_31.
>
This is used to display bookings of holiday properties and works
well. I am now wishing to be able to highlight a range of dates by
double clicking in one text box and then in another, highlighting all
the dates between these.
>
I am creating a double click event for each of the 366 text boxes,
although the body of each is identical in that it calls Sub which does
the work.
>
I am, at the moment, steadily and painstakingly creating these events.
>
What I am wondering is whether is a better way. Could I use the double
click event of the Form or Detail. I.e. if a text box does not have a
double click event is the click passed on to the Form?
>
Any ideas would be welcome. It is working for January, Februay and
March bu I still I have more than 200 events to create!!
>
Jim
That is the hard way! Just create a function that takes the date as a
parameter. Put the function right in the properities dialog for each
textbox like this =HiliteDate(dSelectedDate). There is no need to
actually open a code window. If you are willing to use the default
name of the textbox, you can go to a blank form, and copy the first
textbox, add the double click event, and then copy it 365 times. Then
just copy them all over to the actual form that you want to use.

By the way, standard convention is to hold the shift key while
selecting multiple adjoining items, not double-clicking. I always try
that first.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.