Using the On Double Click Event in Microsoft Access to Open a Customer Record or Increment a Date

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to another tech help video brought to you by accesslearningzone.com i am your instructor richard rost in today's video i'm going to teach you how to use the on doubleclick event we're going to do two separate examples in the first example it's 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 we can click on that and the on click event would increase a date field it would add one date to it in this video we're gonna do the same thing but we'll use the on double click event so instead of having to add a button or a label we'll just double click on the field itself to add a date to it then i'll show you how to use the same event the on doubleclick event on the customer list form so we can double click on their id and open up their customer form all that in today's video today's question comes from anderson from buffalo new york same as yesterday's question and the only reason i'm doing this back-to-back questions for the same guy is because a he's a platinum member and platinum members get away with a lot and b he's from buffalo new york my old hometown but 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 don't need the labels which take up precious space and anderson actually sent me a screenshot of his form he's got a million different text boxes and buttons and controls all crammed into a tiny little i told him i said you gotta break that up into multiple forms but he's happy that he has so he wants to know if there's a way he can just double click on that date field and increase that date value so this is the database from yesterday's video the on click event and in that video we made these little buttons here plus and minus okay and we assign those to the on click event of these labels all right right there on click event now if you haven't watched that video go watch that video and gold members you can download this template if you want to it'll be right on the website so 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 sent now let's review what these guys do click on that go to dot dot all right all those do is say customer sense equals customer sense plus one so let's copy that and let's find the on double click event of the customer sense box okay so go there go to the event tab find on dbl click on double click all right dot dot dot now we're in the customer sent double click event okay paste that's it customer sense equals customer sense plus one now 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's gonna happen what well you could use a control tip if you want to right come in here go to where is it under all control tip text right double click to increase or increase increment increment date like that that's a control tip text that's what happens when you hover over a field right hover over that see double click the increment date and now double click double click double click double click see that and now we can get rid of those labels that are taking up precious space yeah anderson's a long time customer so i can mess with them a little bit now 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 okay now in this template you can see here the id field is blue okay this is the tech help free template i started off with a blank template which had the customers in it okay then i added i added this customer list form then i added contacts so there's contacts in here too then after this i even added uh invoicing which where's the invoicing button i think it's under here uh yeah orders it's got invoicing so you can get all this is all free it's all on my website download this template if you want to everybody can download it not just gold members all right somewhere along the line i added this on doubleclick event here and i never recorded it i can't find the video that i recorded it i'm 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'll get a free month of silver membership on me i can't i try to find it so i want to make sure i included it in this video too okay if you go into design view on the customer list this is a continuous form again if you've never done continuous forms before i've got videos for that i'll put a link down in the section below basically it's the the the blank customer template video okay but again it's the customer id double click on that go to events there's the on double click is right here all right now what is this well there's two lines of code in here okay it says if is null customer id then exit sub that means if i'm on the blank new record down here let me show you if i'm on the blank new record down here where it says new if you double click nothing happens okay that's what if is null customer id means okay the second line is do command.open form and i've got videos on open form if you've never used that before it's basically opens another form customer f is the form name okay comma comma comma those are some parameters we don't need to worry about right now i cover those in my full classes but for this example we don't need those all we need to worry about is this guy here the where condition alright see the where condition it says customer id equals customer id and it concatenates those together if you don't know what string concatenation is so you put two strings together this is technically a string and a number but it's the same thing okay i have videos on concatenation to go watch that this just says take the current customer id on this form whatever number you happen to be on slap it in there with customer id equals and send it to open form so it's going to be open form customer f where customer id equals three or six or whatever number i happen to be on so there's three double click boom see it sends a three in there and it opens up that form so that's the on doubleclick event really easy to do the command button which is up here in the command button tools right that'll open up this one but that's a little hard for some users to remember to click on a customer then click on open form okay it's easier to just make this a double click event right there and you can extend that if you want to you could put that in all of these fields so they could 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 all right and i like to make it blue right that's just my thing uh is it that color blue that's close enough right it's a little bit different i think but anyways last name event on double click right there and we can basically just copy this code copy and then paste like that that's the same thing open the customer form where the customer id equals the current customer id all right open the customer list double click on picard boom there you go it's that easy and 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 doubleclick event in my access developer 4 class i'll put a link to that down below want to learn more about the on doubleclick event in the extended cut for the members i'm going to show you how to prevent accidental double clicks you probably had this happen before you got a button no matter what it does right you want to do one thing but your users sometimes double click on it or maybe you do i don't know don't blame the users for everything right so what i'll do is i'll show you how to make it so your on click event runs but it only runs once and if they accidentally double click on it like a delete for example it won't run it twice and delete two records or add two days to the customer sense okay and of course for the delete i'll show you how to add a pop-up message box that says are you sure and if they don't say yes it exits out but 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'll 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 tech help 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 tech help 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 but don't worry these free tech help videos are going to keep coming as long as you keep watching them i'll keep making more if you like 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'll 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'd like to get an email every time i post a new video click on the link to join my mailing list now if you have not yet tried my free access level one course check it out now it covers all the basics of building databases with access it's over three hours long you can find it on my website or my youtube channel and if you like level one level two is just one dollar and it's 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 tech help page and you can send me your question there click here to watch my free access beginner level one course more of my tech help videos or to subscribe to my channel thanks for watching this video from accesslearningzone.com
Info
Channel: Computer Learning Zone
Views: 4,634
Rating: 4.909091 out of 5
Keywords: microsoft access, ms access, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #instruction, #learn, #lesson, #training, #database, double click, on double click, on dbl click, ondblclick, prevent double click on a button, msgbox, are you sure, vbyesnocancel
Id: wQLQ21wZV9Y
Channel Id: undefined
Length: 10min 58sec (658 seconds)
Published: Tue Feb 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.