473,416 Members | 1,565 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,416 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 3155
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.