473,287 Members | 3,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

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

Nov 9 '07 #1
6 3146
On Nov 9, 6:16 am, Jim Devenish <internet.shopp...@foobox.comwrote:
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.

Nov 9 '07 #2
On Nov 9, 3:21 pm, OldPro <rrossk...@sbcglobal.netwrote:
On Nov 9, 6:16 am, Jim Devenish <internet.shopp...@foobox.comwrote:
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.
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
Nov 9 '07 #3
On Nov 9, 3:42 pm, Jim Devenish <internet.shopp...@foobox.comwrote:
On Nov 9, 3:21 pm, OldPro <rrossk...@sbcglobal.netwrote:
On Nov 9, 6:16 am, Jim Devenish <internet.shopp...@foobox.comwrote:
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.

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
Nov 9 '07 #4
On Nov 9, 9:54 am, Jim Devenish <internet.shopp...@foobox.comwrote:
On Nov 9, 3:42 pm, Jim Devenish <internet.shopp...@foobox.comwrote:


On Nov 9, 3:21 pm, OldPro <rrossk...@sbcglobal.netwrote:
On Nov 9, 6:16 am, Jim Devenish <internet.shopp...@foobox.comwrote:
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.
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- 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.

Nov 9 '07 #5
On Fri, 09 Nov 2007 04:16:12 -0800, Jim Devenish
<in***************@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.

>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
Nov 9 '07 #6
On Nov 9, 6:16 am, Jim Devenish <internet.shopp...@foobox.comwrote:
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.

Nov 12 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike | last post by:
Hey guys I am pulling my hair out on this problem!!!!! Any help or ideas or comments on how to make this work I would be grateful! I have been working on this for the past 4 days and nothing I do...
1
by: Dee | last post by:
I have a field "TerritoryID" on a subform. It has a Dbl Click event as follows: Private Sub TerritoryID_DblClick(Cancel As Integer) Forms!FmDealer5!Text152 = DealerID '**Retrieves DealerID...
4
by: perspolis | last post by:
hi I manage a double click event in a combo box.. but this event doesn't fire ???? I don't know why??
3
by: BakelNB | last post by:
I am new to the .Net environment, so please bear with me. I am passing a form object (e.g. formA) to an existing form (e.g. formB) by setting a property value defined in formB to hold the formA...
3
by: Siv | last post by:
Hi, I have a ListView control in a Windows application, currently single clicking a customer name in this list, selects the customer and displays their details in text boxes to the right of the...
2
by: Siv | last post by:
Hi, I posted earlier in the week and no-one responded so i thought I would try again. My question is: I have a ListView control in a Windows application, currently single clicking a customer...
5
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event...
2
by: scott_gui | last post by:
I am creating a Windows application: The mouse event <Double-Button-1> has a conflict when the <Button-1> event also has a binding. Double clicks will first perform the single click action. This...
4
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.