Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > On Dbl Click > < On Click | Report Listbox >
On Double Click
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   5 years ago

Using the On Double Click Event. Open Record.


 S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark Join Now

In this Microsoft Access tutorial, I'm going to teach you how to use the On Double Click event to increment a date field by one day. This way you can just double-click on the date field itself to increase its day by one. I'll also show you how you can use this technique to open a customer's record by double-clicking on his ID in the customer list form.

Anderson from Buffalo, New York (a Platinum Member) asks: I watched your On Click Event video. It was awesome. Exactly what I asked for. Is there any way you can do the same thing with a Double Click? This way I don't need the labels which take up precious space.

Members

I'll show you how to cancel a double-click event to prevent the user from clicking twice on a button. You've had it happen before: the user thinks they have to double-click on a button and now they've made the On Click event run twice (deleted two records instead of one, for example). I'll show you how to deal with that. And I'll also show you how to pop up an "Are you sure?" warning message.

Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the files from class plus get access to the Code Vault. If you're not a member, Join Today!

What Course?

On Double Click is Covered in...

Links

On Click: https://599cd.com/OnClick
Continuous Forms: https://599cd.com/Continuous
Customer List Form: https://599cd.com/CustomerListForm
Concatenation: https://599cd.com/Concatenation
https://docs.microsoft.com/en-us/office/vba/api/access.form.dblclick

Learn More

FREE Access Beginner Level 1
FREE Access Quick Start in 30 Minutes
Access Level 2 for just $1

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates

Resources

Diamond Sponsors - Information on our Sponsors
Mailing List - Get emails when new videos released
Consulting - Need help with your database
Tip Jar - Your tips are graciously accepted
Merch Store - Get your swag here!

Questions?

Please feel free to post your questions or comments below or post them in the Forums.

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to On Double Click
Get notifications when this page is updated
 
Intro In this video, I will show you how to use the On Double Click event in Microsoft Access with two practical examples. First, you will learn how to increment a date field by simply double clicking on it, eliminating the need for extra buttons or labels. Then, I will demonstrate how to set up a double click event on a customer list form so you can open a customer's detailed form by double clicking their ID or last name. These tips help streamline your forms and make them more user friendly.
Transcript Welcome to another TechHelp video brought to you by AccessLearningZone.com. I am your instructor, Richard Rost.

In today's video, I am going to teach you how to use the On Double Click event. We are going to do two separate examples.

In the first example, it is going to be just like the On Click event from yesterday's video. In that video, we made a little button and then a little label so you can click on that and the On Click event would increase a date field. We would add one day to it.

In this video, we are going to do the same thing, but we will use the On Double Click event. So instead of having to add a button or a label, we will just double click on the field itself to add a day to it.

Then I will show you how to use the same event, the On Double Click event, on the customer list form so we can double click on their ID and open up their customer form. All of that in today's video.

Today's question comes from Anderson from Buffalo, New York. Same as yesterday's question. The only reason I am doing back-to-back questions for the same guy is because A, he is a platinum member and platinum members get away with a lot, and B, he is from Buffalo, New York, my old hometown.

Anderson says, I watched your On Click event video. It was awesome. Thank you. Exactly what I asked for. Is there a way you can do the same thing with a Double Click? This way I do not need the labels which take up precious space.

Anderson actually sent me a screenshot of his form. He has got a million different text boxes and buttons and controls all crammed into a tiny little, I told him I said you have got to break that up into multiple forms, but he is happy that he has it. So he wants to know if there is a way he can just double click on that date field and increase that date value.

This is the database from yesterday's video, the On Click event. In that video, we made these little buttons here, plus and minus. We assigned those to the On Click event of these labels, right there, On Click event.

If you have not watched that video, go watch that video. Gold members, you can download this template if you want to. It will be right on the website.

What Anderson wants to do is instead of having to click on these labels which take up precious space, he wants to just be able to double click on Customer Since.

Now, let's review what these guys do. Click on that, go to dot dot dot. All those do is say Customer Since equals Customer Since plus one. So let's copy that. Let's find the On Double Click event of the Customer Since box.

Go there, go to the Event tab, find On DBL Click, On Double Click. Dot dot dot. Now we are in the Customer Since double click event. Paste. That is it. Go to the Event tab and find out what the Customer Since is.

What I like to do for anything with a double click event in it, to signal the user that you can do some stuff, is I like to format it. I make mine blue, like a light blue like that. This just visually tells the user, hey, if you click on this field, something is going to happen. What? You could use a control tip if you want to. Come in here, go to where is it? Under All, Control Tip Text. Click to increase, increase increment, increment date, like that. That is a control tip text. That is what happens when you hover over a field. Hover over that. See, double click to increment date.

Now double click, double click, double click, double click, double click, see that? Now you can get rid of those labels that are taking up precious space.

Anderson is a long time customer, so I can mess with him a little bit.

One thing that I also like to do with this ability to double click on stuff is I like to use it to open up other records. For example, let's save this.

In this template, you can see here the ID field is blue. This is the TechHelp free template. I started off with a blank template, which had the customers in it. Then I added this customer list form. Then I added contacts, so there are contacts in here too. After this, I even added invoicing, which was the invoicing button. I think it is under here. Yeah, Orders. It has got invoicing. You can get all this for free. It is all on my website. Download this template if you want to. Everybody can download it, not just gold members.

Somewhere along the line, I added this On Double Click event here, and I never recorded it. I cannot find the video that I recorded it in. I am going to give a bonus. If anyone can find the other video where I added that to the templates, send me the video link and the time index and you will get a free month of silver membership on me. I tried to find it. I want to make sure I included it in this video too.

If you go into Design View on the customer list, this is a continuous form. If you have never done continuous forms before, I have got videos for that. I will put a link down in the section below. Basically, it is the blank customer template video.

Again, it is the customer ID. Double click on that. Go to Events. The On Double Click is right here.

Now, what is this? There are two lines of code in here. It says, if IsNull CustomerID, then Exit Sub. That means if I am on the blank new record down here (let me show you), if I am on the blank new record down here where it says New, if you double click, nothing happens. That is what if IsNull CustomerID means.

The second line is DoCmd.OpenForm. I have got videos on OpenForm if you have ever used that before. It basically opens another form. CustomerF is the form name. Comma, comma, comma. Those are some parameters we do not need to worry about right now. I cover those in my full classes, but for this example, we do not need those. All we need to worry about is this guy here, the WhereCondition.

See the WhereCondition? It says CustomerID equals CustomerID and it concatenates those together. If you do not know what string concatenation is, it is when you put two strings together. This is technically a string and a number, but it is the same thing. I have videos on concatenation too; go watch that.

This just says take the current CustomerID on this form, whatever number you happen to be on, slap it in there with CustomerID equals and send it to OpenForm. So it is going to be OpenForm CustomerF where CustomerID equals three or six or whatever number I happen to be on.

So there is three. Double click. Boom. See, it sends a three in there and it opens up that form.

That is the On Double Click event, really easy to do. The command button, which is up here in the command button tools, will open up this one, but that is a little hard for some users to remember. To click on a customer, then click on OpenForm. It is easier to just make this a double click event right there.

You can extend that if you want to. You can put that in all these fields so they can double click here and it opens up that. Let me show you.

Design View. Let's make it so they can click on Last Name. I like to make it blue. That is just my thing. Did that color blue? That is close enough. It is a little bit different, I think.

Last Name, Event, On Double Click, right there. We can basically just copy this code, copy and then paste like that. It is the same thing. Open the customer form where the CustomerID equals the current CustomerID.

Open the customer list, double click on Picard. Cool. There you go. It is that easy.

That is what I forgot to put in the template videos. So now I can add this one to the list.

Learn more about the On Double Click event in my Access Developer 4 class. I will put a link to that down below.

Want to learn more about the On Double Click event? In the extended cut for the members, I am going to show you how to prevent accidental double clicks. You have probably had this happen before: you have a button, no matter what it does, you want it to do one thing, but your users sometimes double click on it. Or maybe you do. Do not blame the users for everything.

What I will do is show you how to make it so your On Click event runs, but it only runs once. If they accidentally double click on it, like for a delete, for example, it will not run it twice and delete two records or add two days to Customer Since.

For the delete, I will show you how to add a pop-up message box. It says, are you sure? If they do not say yes, it exits out. Preventing that accidental double click is the main focus of the extended cut for members.

Silver members and up get access to all of my extended cut videos. How do you become a member? Click the Join button below the video. After you click the Join button, you will see a list of all the different types of membership levels that are available.

Silver members and up will get access to all of the extended cut TechHelp videos, live video and chat sessions, and more. Gold members get access to a download folder containing all the sample databases that I build in my TechHelp videos, plus my code vault where I keep tons of different functions that I use.

Platinum members get all the previous perks plus access to my full beginner courses and some of my expert courses. These are the full-length courses found on my website, and not just for Access. I also teach Word, Excel, Visual Basic, ASP, and lots more.

Do not worry, these free TechHelp videos are going to keep coming. As long as you keep watching them, I will keep making more.

If you liked this video, please give me a thumbs up and feel free to post any comments that you have. I do read them all. Make sure you subscribe to my channel, which is completely free, and click the bell icon and select all to receive notifications when new videos are posted.

Click on the Show More link below the video to find additional resources and links. You will see a list of other videos, additional information related to the current topic, free lessons, and lots more.

YouTube no longer sends out email notifications when new videos are posted, so if you would like to get an email every time I post a new video, click on the link to join my mailing list.

If you have not yet tried my free Access Level 1 course, check it out now. It covers all the basics of building databases with Access. It is over three hours long. You can find it on my website or on my YouTube channel. If you like Level 1, Level 2 is just 1 dollar. It is also free for all members of my YouTube channel at any level.

Want to have your question answered in a video just like this one? Visit my TechHelp page and you can send me your question there.

Click here to watch my free Access Beginner Level 1 course, more of my TechHelp videos, or to subscribe to my channel.

Thanks for watching this video from AccessLearningZone.com.
Quiz Q1. What is the main topic of this video?
A. Using the On Double Click event in Microsoft Access
B. Creating reports in Microsoft Access
C. Designing tables in Microsoft Access
D. Setting user permissions in Access

Q2. How does the On Double Click event improve form usability compared to using buttons or labels?
A. It allows navigation without saving records
B. It allows users to double click directly on a field to trigger actions, saving space
C. It automatically updates all fields with one click
D. It requires more controls on the form

Q3. In the video example, what does double clicking on the "Customer Since" field accomplish?
A. Decreases the date by one day
B. Deletes the record
C. Increases the date by one day
D. Opens a related report

Q4. Why did Anderson want to use the On Double Click event instead of labels?
A. Labels are difficult to create
B. The form crashed with labels
C. Labels take up precious space on the form
D. Double click is faster than clicking a label

Q5. What visual cue does Richard recommend adding to fields with a double click event?
A. Make the text bold
B. Add a popup message
C. Change the background color to blue
D. Increase the font size

Q6. What can be displayed when a user hovers over a field with a double click event?
A. The source table name
B. A control tip text explaining the action
C. The record count
D. Form properties window

Q7. What does the code 'If IsNull(CustomerID) Then Exit Sub' prevent?
A. Running the event on existing records only
B. Opening forms with invalid CustomerID
C. Running the code on the blank new record
D. Editing locked records

Q8. What does 'DoCmd.OpenForm' do in the context of the On Double Click event?
A. Saves the current record
B. Opens a form specified by name, filtered to a particular record
C. Closes the current form
D. Deletes a form from the database

Q9. In the customer list form, what is the benefit of using a double click event on the CustomerID field?
A. It opens the CustomerF form for that specific customer
B. It opens all customer records
C. It exports data to Excel
D. It deletes the customer

Q10. How can you prevent accidental double clicks from running an event twice, as mentioned for the extended cut for members?
A. By removing all double click events
B. By using code to ensure the event runs only once
C. By reducing the button size
D. By disabling user input

Q11. Which membership level allows downloading all sample databases and accessing the code vault?
A. Silver
B. Gold
C. Bronze
D. Free user

Q12. What is string concatenation in the context of the OpenForm method shown in the video?
A. Adding numbers together
B. Splitting fields into two
C. Joining two strings (or string and number) together to build a WhereCondition
D. Sorting records by name

Q13. If a user wants to apply the On Double Click event to open a form from multiple fields, what should they do?
A. Assign the On Double Click event and code to each desired field
B. Only assign to one field at a time
C. It is not possible to use On Double Click in this way
D. Change the form property instead

Q14. What is the suggested way to indicate to users that a double click event is available on a field?
A. Bold the field name
B. Change the color and add a helpful control tip text
C. Hide the field
D. Make the field read-only

Q15. Which of these is NOT mentioned as a membership benefit in the video?
A. Access to extended cut videos
B. Receiving free gifts by mail
C. Download sample databases
D. Access to full-length courses

Answers: 1-A; 2-B; 3-C; 4-C; 5-C; 6-B; 7-C; 8-B; 9-A; 10-B; 11-B; 12-C; 13-A; 14-B; 15-B

DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.
Summary Today's video from Access Learning Zone focuses on how to use the On Double Click event in Microsoft Access. I am Richard Rost, your instructor, and I will guide you through two practical examples of how this event can be used in your forms.

First, let me recap the On Click event from yesterday's video. In that session, we created buttons and labels so that clicking on them would increase the value of a date field by one day. Today, we are going to achieve the same result, but instead of relying on a separate button or label, we will use the On Double Click event attached directly to the field. This way, by simply double clicking on the date field itself, we can increment the date without adding more controls to your form, saving valuable space.

The second example will demonstrate how the On Double Click event can be applied in a customer list form. Here, you will learn how double clicking on a customer's ID in the list will instantly open up that customer's detail form, streamlining the navigation process within your database.

The question for today's lesson was inspired by Anderson from Buffalo, New York, who also submitted the question for yesterday's session. He wanted to know if it was possible to replicate the On Click event functionality with a double click, eliminating the need for extra labels that crowd the form. Anderson shared a screenshot of his heavily packed form, which highlighted the need for more space-efficient solutions.

To start, we will use the database developed in the previous On Click video. In that setup, we placed plus and minus labels to handle incrementing and decrementing the "Customer Since" field when clicked. For today's improvement, you no longer need to rely on those labels. Instead, I will show you how to assign the relevant code to the On Double Click event of the date field itself. With this approach, whenever you double click on that field, it will add one day to the date.

For usability, I recommend visually indicating when a field has interactive functionality. I often set the background color of such fields to a light blue to catch the user's eye. Additionally, you can use the Control Tip Text property to display a helpful message when users hover their mouse over the field, such as "Double click to increment date." This makes it clear that double clicking will take a specific action.

Once implemented, you will see that double clicking on the "Customer Since" field immediately increments the date, rendering the previous labels unnecessary and clearing up space on your form.

Next, I want to show you another effective use of the On Double Click event. In my free TechHelp template, I have a customer list form in continuous form view. If you enable the On Double Click event on the customer ID control, you can make it so that double clicking a customer's ID opens the related customer form. The code behind this event checks if the Customer ID is null (to prevent errors if you try to open a form from an empty record), and then uses the OpenForm command with the correct parameters to display the desired customer record. The key here is the WhereCondition, which uses string concatenation to match the current ID.

I encourage you to apply this logic to other fields as well, such as a last name field, to offer multiple intuitive entry points for users to open customer records. When setting up these controls, again, I recommend using a blue background as a cue and providing appropriate tooltips.

For further exploration of the On Double Click event, check out my Access Developer 4 class, which is linked below for your convenience.

In the Extended Cut of today's lesson, available for members, I will teach you how to prevent problems caused by accidental double clicks. For example, it's common for users to double click a button by mistake, which could cause actions like deleting records or incrementing values more than once. I will show you how to make sure your On Click events only run once per action and add a confirmation dialog for destructive actions like deletions. Avoiding these accidental double actions is our focus in the Extended Cut, so if you're a member, be sure to check it out.

Silver members and above can access all of my extended cut videos. By becoming a member, you can also attend live sessions and access download folders that include all sample databases and the code vault. Platinum members get even more benefits, including my full Access beginner and expert courses, as well as courses covering other Microsoft Office programs.

Rest assured, my free TechHelp videos will continue as long as there is viewer interest. Please support the channel by liking the video, leaving your comments (I read every one), subscribing, and hitting the bell icon for notifications about new content.

Below the video, you will find additional resources, recommended videos, related links, and other free lessons. Note that YouTube does not send email notifications anymore, so if you want email alerts when new videos are released, you can join my mailing list using the link provided.

If you haven't already checked out my free Access Level 1 course, now is a great time. It covers database basics over three hours of content and is available both on my website and YouTube. If you move on to Level 2, it's only one dollar or free to all channel members.

If you would like your question featured in a future video, just visit my TechHelp page and submit it there.

You can find my complete video tutorial with step-by-step instructions on everything covered here on my website at the link below.

Live long and prosper, my friends.
Topic List Using the On Double Click event to increment a date field

Assigning VBA code to the On Double Click event of a text box

Visually indicating interactive fields using formatting

Adding Control Tip Text to fields for user guidance

Using the On Double Click event to open a related record form

Writing conditional VBA to handle new records in double click events

Passing the current record ID to OpenForm with WhereCondition

Implementing double click events on multiple fields in a continuous form
 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/21/2026 12:39:47 AM. PLT: 1s
Keywords: TechHelp Access double click, on double click, on dbl click, ondblclick, prevent double click on a button, msgbox, are you sure, vbyesnocancel  PermaLink  On Double Click in Microsoft Access