Edge Browser 2
By Richard Rost
3 years ago
Generate QR Codes with Edge Browser Control
In this Microsoft Access tutorial, I'm going to show you how to use the new Edge Browser Control.
In Part 2 we will be generating QR Codes using the Google API. This is an improvement over my previous QR Code video because the new Edge Browser Control supports continuous forms and reports.
Members
There is no extended cut, but here is the database download:
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!
Prerequisites
Keywords
TechHelp Access 2016, Access 2019, Access 2021, Access 365, Microsoft Access, MS Access, MS Access Tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, Edge Browser Control, Microsoft Access Edge integration, QR Code generation in Access, Google API QR Codes, Access continuous forms QR, Access reports QR Code, Using Edge in Access, QR Code Access reports, Access database QR Codes, Generate QR Code Access, Edge Browser Access functionality, Implementing Edge in Access, Custom QR Codes with Access, Embedding Edge in Access forms.
Subscribe to Edge Browser 2
Get notifications when this page is updated
Intro
In this video, we take a look at using the new Microsoft Edge browser control in Microsoft Access to display dynamic QR codes in your reports. I will show you how to create a simple product table, generate QR code links using the Google Charts API in a query, and then display those QR codes on a report using the Edge browser control, all without any VBA code. You will learn how to build calculated fields, work with string concatenation, and set up your report to show scannable QR codes for your data. This is part 2.
Transcript
Welcome to another TechHelp video brought to you by AccessLearningZone.com. I am your instructor, Richard Rost.
In today's video, we are taking another look at the Edge browser control, the new browser control released by Microsoft for Access. This is part two. In today's video, we are going to do an update on a previous video I did a while back on how to generate QR codes in your Access database.
About two years ago, I did a video on how to generate QR codes using the Google API, which is free. Essentially, you can get QR codes for pretty much anything you want in your database. The problem with the old browser control is that it does not work in continuous forms or reports.
I had to use a bunch of VB code and teach the members in the extended cut how to download the QR code as an image to your local drive. Then you could put it into a continuous form or report. This technique is still handy if you want to keep those images local, such as in your database folder, for example. However, if you do not care about all that and just want to display them and print them, with the new Edge browser control, you can put them in a report like this. Let me show you how to do it.
This is part two of my Edge browser series. If you have not watched part one yet, go watch that—it's free on my website. There is a link right there, a little QR code for you right there that you can scan. It is on my YouTube channel and on my website. It is free, so go watch it and then come back.
I do have this marked as a beginner video. We do not need any VBA code to do this; it is relatively simple. However, you will need to know how to make a calculated field in a query, and you should know about string concatenation—that is, putting two strings together. If you have not watched these two videos, go watch them now. You will find links down below in the description under the video window, and you can go watch them and then come back.
Here I am in my TechHelp free template. This is a free database. You can grab a copy from my website if you want to, but what I am going to show you today is something you can pretty much do in any database. Let's create a real simple product table. Create table design.
We have our product ID—that is our autonumber, the product name. Remember, do not use just "Name" as a field name; "Name" is a reserved word. Set it as Short Text. Then let's have a product code, and that product code is what you want to use to generate our QR code. You can put whatever other fields in here you want, such as unit price, quantity on hand, or whatever else you want about your product, maybe a picture, that kind of stuff.
I am just going to save this. This is our nice little demo table here. Save this as ProductT, my product table. Primary key, there you go. Let's put a few things in here. I am going to use myself for example.
Let's say I am just putting in my different tutorials as my videos, as my products. I have my DLookUp tutorial, and let's say the product code for this is dlookup. I have Access Beginner 1, and that is acb1. One more: let's say I have my Excel VLOOKUP, and the product code for that is vlookup. You get the point here. You put the product name in and your product code.
Let's close this.
Now let's make a query that is going to build the Google API link for that particular product code. I cover this in my other QR code video. In that video, I talked about the Google Charts API and how you can generate QR codes for free using a link to their site. I also show you the basic structure that you have to use for that link. Let me show you again real quick.
This is the basic structure of the URL that you have to build in order to display a QR code. It is https://chart.googleapis.com/chart, then a question mark to begin the list of arguments. "chl" is your value—whatever you put in here is what the QR code is going to be made up of, and "chs" is 200x200, which is the size of the QR code. That is a good size, and I like it. The chart type is "qr" for QR code. All you have to really do is replace your product code with this value here.
We will do that inside of a query. Go to Create - Query Design. Bring in our product table. Let me close all this stuff. Bring down the star, and then we are going to make a new calculated field right here. I am going to shift up to zoom in so we can see it better.
I am going to copy and paste in that stuff I had in my PowerPoint slide here. There is the actual link. Now we have to make this into an actual calculated field. Let's just call this qrLink: and then we will put that inside of quotes, the whole thing inside of quotes.
Now we want to replace this value here with our product code. What we are going to do is end the string, add product code, and start the string again. Do not get confused with the ampersands that are outside the string and the stuff inside the string, which is for the actual URL. I know it is two different sets of ampersands going on here.
Now, click OK. If you run it, you will see all your links are built for you right there. That is the actual value that is going to be made up of the product code. Let's save this as my ProductQ.
Now we can use this to build our report. I already have a blank report template right here. I am going to copy and paste this guy—copy, paste—it is just a blank report with all my default settings. We will call this MyProductR, and then I will design this guy in Design View.
I am going to make this smaller; it does not need to be quite that big. Let's get rid of this field in here—I am just getting rid of all the empty space for the headers that I do not need. Get rid of those. You can put headers and footers on if you want to.
Set the Record Source under Data—that is now going to be our ProductQ. That is another reason why I like to have my T's and Q's on the end of my products and tables: ProductQ.
Add existing fields: You can bring all these guys in if you want to, but you do not need to bring in the qrLink, as you will see in a second. It will show you the link here, but what we want right here is the browser control to display that. I will bring it in here anyway just so you can see it.
Right here is where we put our browser control. Pick this guy, drag a box for it right there. It is going to ask you where you want to bind it; just cancel that. Open up its properties. I call it wb for my web browser, and the Control Source—we are going to bind it to that qrLink.
Save it, close it, close it. Open it up, right click on the product there, and go to Print Preview. It takes a second to generate the QR codes, and there they are. Let's zoom in. You can see there they are—unique QR codes.
If you scan this, as I just tried with my phone, you are literally just going to get the word "dlookup." That is what that QR code says: dlookup.
If you have your products on your website like I do, you might want to have that QR code actually go to a page on your website using that product code. Let's go back to our query: ProductQ Design View.
Take a look at this qrLink now, right here. Everything after chl= is where you can put your URL to wherever this product appears on your website. You can enter something like https://599cd.com/ and, for me, I have the product code—just a tiny link system on my website. So "/dlookup" will go right there, "/acb1" for Access Beginner 1. It will take the user right to that page. If you have a product lookup on yours, you could do something like "/product?id=" and then your product code, whatever your website is set up for.
For me, all I need is that.
Now when I click OK and take a look at what I have, those are all actual links to my products, my different tutorials: my DLookUp video, my Access Beginner 1 video, and so on. Now the QR code will have that in it. If the user scans it with their phone, that is where they go. Save this, close it. Go back to that report again. Right click, Print Preview. Takes a second. There you go. Let's zoom in. You can see the QR code is a little more complex now. The more data that you have in that QR code, the more characters there are, the more complex the sketch.
If you scan one of these—yes, I just tried it with my phone—it takes you right to my website and right to that page.
Keep in mind, this is just displaying them. You can display them here; you can print them. Every time you go to display them, though, it is going to have to go out to Google and get a copy of them, which is a bit slow, and you cannot use it offline, apparently.
If you do want the ability to download these QR codes and save them in your database folder, for example, I cover that in the extended cut from my older QR code video. Go check that out. I will put a link to it down below.
That is your TechHelp video for today. This is part two of the Edge browser series. I have a couple more videos coming up. I am going to show you how to actually do dynamic things with the browser, like send values to the page and retrieve values from the page. That is going to require some VBA programming though, so the next couple videos will be for developers.
For everybody else, I hope you learned something today. Live long and prosper, my friends. I will see you next time.
Quiz
Q1. What is one main advantage of the new Edge browser control in Access compared to the old browser control when generating QR codes? A. It works in continuous forms and reports, allowing easier display and printing B. It allows QR code generation without any internet connection C. It stores QR codes as images automatically in the database D. It is compatible only with Microsoft SQL Server
Q2. Why might you still use the older technique of downloading QR code images to your local drive? A. If you need to access QR codes while offline or keep local image copies B. If you want automatic resizing of QR codes C. When you only need to display QR codes temporarily D. Because it requires less setup and configuration
Q3. What essential Access concept should you know to follow the steps in this tutorial? A. How to make a calculated field in a query B. How to create VBA modules for reports C. How to build macros from scratch D. How to design SQL Server stored procedures
Q4. What is string concatenation in the context of generating a QR code link? A. Combining text elements together to build the full URL for the QR code B. Converting numbers to strings C. Dividing a string based on specific characters D. Encrypting a string for security
Q5. Why should you avoid naming a field "Name" in an Access table? A. Because "Name" is a reserved word in Access B. Because it cannot store non-text values C. Because it is not supported in reports D. Because it will make queries significantly slower
Q6. What is the main purpose of the field 'product code' in the ProductT table for this example? A. It is used to uniquely identify products in the QR code URL B. It stores the price of the product C. It is used only for sorting reports D. It links to customer data in another table
Q7. When building the link for the Google QR code API, which parameter defines what information the QR code will contain? A. chl B. chs C. cht D. url
Q8. What size is set for the QR codes in the provided example API link? A. 200x200 B. 100x100 C. 250x250 D. 150x150
Q9. When creating the calculated field for the QR code link in a query, how is the product code incorporated? A. By concatenating the field value directly into the URL string B. By hardcoding a value into the query C. By assigning the product code to a temporary variable D. By using an append query to add the value
Q10. What property of the Edge browser control do you set to bind it to the QR code URL in the report? A. Control Source B. Caption C. Default Value D. Row Source
Q11. What happens if you scan one of the initial QR codes generated in the example (before modifying the link to a full website URL)? A. You get the product code text displayed B. You are taken to the AccessLearningZone homepage C. You download an image of the QR code D. You get an error message
Q12. If you want the QR code to take the user to a product web page, what should you include after 'chl=' in the Google Charts API URL? A. The full URL to the product page, possibly with the product code appended B. Only the product name C. Only the product ID D. The report name
Q13. What is a limitation of this Edge browser QR code technique when displaying and printing QR codes in Access? A. It requires an internet connection to retrieve QR codes from Google each time B. It cannot be used for products with images C. It only works on Windows 7 D. It requires complex VBA programming
Q14. What is one recommended naming convention mentioned for tables and queries? A. Add "T" to tables and "Q" to queries for clarity B. Start all table names with "db" C. Use numerical suffixes to indicate object type D. Reuse field names across tables and queries
Q15. If you want to download and store QR code images locally for offline use, what should you do? A. Follow the extended cut tutorial using VBA B. Use the current Edge browser control technique only C. Edit the report source to store images automatically D. Switch to using the old Internet Explorer control
Answers: 1-A; 2-A; 3-A; 4-A; 5-A; 6-A; 7-A; 8-A; 9-A; 10-A; 11-A; 12-A; 13-A; 14-A; 15-A
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 TechHelp tutorial from Access Learning Zone is focused on the Edge browser control, the new browser control that Microsoft has introduced for Access. In this lesson, I am providing an update to a video I released a couple of years ago that covered generating QR codes in your Access database using the Google API, which is a free service. That original method allowed you to create QR codes for virtually any value stored in your database. The significant limitation with the old browser control, however, was that it could not display QR codes in continuous forms or reports.
Previously, to get QR codes into your reports, I had to use Visual Basic code to download the QR code images to your local drive. Then you could insert those images into forms or reports. That method still works and can be useful if you want all images stored locally, perhaps in your database folder. But if your only goal is to display or print QR codes, the new Edge browser control offers a much simpler solution. With it, you can easily place QR codes right into a report. That is what I am going to demonstrate today.
Keep in mind this is the second part of my series on the Edge browser control. If you have not watched the first part yet, I recommend starting with that one. It is available for free on my website and my YouTube channel.
This lesson is intended for beginners. There is no need for VBA code. The only concepts you will need to be comfortable with are creating calculated fields in queries and understanding string concatenation - that is, joining together two or more strings.
I am using my free TechHelp template database for this demonstration, which you can download from my website if you like. However, the steps I am showing you will work with any database. First, create a simple product table. It should include fields like ProductID (as an autonumber), ProductName (as short text - remember, do not use "Name" as a field name because it is a reserved word in Access), and ProductCode, the value we will use to generate our QR codes. Feel free to add other fields such as price or stock quantity if you want.
Once that is set up, enter a few sample records. For my example, I am using some of my tutorial videos as products. I have "DLookUp Tutorial" with the code "dlookup," "Access Beginner 1" with "acb1," and "Excel VLOOKUP" with "vlookup." Enter your own sample data as you like.
Next, create a query to build the Google API link for each product code. The structure of the URL to generate a QR code using the Google Charts API is straightforward. It starts with the base URL, followed by parameters for the data to encode ("chl"), the size ("chs" set to 200x200 pixels is a good default), and the chart type ("qr" for QR code). The key point here is to replace the value of "chl" with your product code or whatever data you want to be encoded into the QR code.
In your query, set up a calculated field, maybe call it "qrLink," that constructs this link using string concatenation. Make sure you combine the pieces of the URL correctly, inserting your product code right where it belongs in the URL.
Once the query is saved (for example, as ProductQ), use it as the record source for a new report. If you already have a report template, you can copy that or simply create a new blank report. Assign ProductQ as the record source for your report.
Drag your product details onto the report as needed, but the real key here is adding the Edge browser control. Insert that into the report where you want the QR code to appear. In the control's properties, bind its control source to your qrLink field. After saving your changes and opening the report in Print Preview, Access will generate and display unique QR codes for each product based on the code in your query. If you scan one of these QR codes, you will get the exact value you entered - in my case, just the product code like "dlookup".
If you want your QR codes to point users to a web page for each product, just modify the link built in your query. Use your website's URL and append the product code as appropriate for your own site's structure. For example, if your product is accessible at "https://yourwebsite.com/product?id=productcode", concatenate your site URL, the path, and the product code in the query. Now, when users scan a QR code, their browser will go straight to your product's page.
Do note that using the browser control this way is just for display and printing purposes. It fetches the QR code from Google each time you view the report, so you will need to be online, and it may take a moment to download each time you open the report or print it.
If you need to save the QR code images to your computer or into a local folder for offline use - for example, if you want to include them in forms or reports independent of a network connection - I discussed how to do this with VBA code in the extended cut of a previous QR code video. You can find a link to that video below.
This lesson wraps up part two of my Edge browser control series. In the next videos, I will cover more advanced techniques, including dynamic interaction with the browser, which will require some VBA coding and is aimed at those interested in development work.
I hope you found this tutorial useful. You will find a complete video with step-by-step instructions for everything discussed here on my website at the link below.
Live long and prosper, my friends.
Topic List
Creating a product table for QR code generation Defining fields for product ID, name, and product code Populating the product table with sample data Building a query to construct Google QR code API links Using calculated fields for dynamic QR code URLs Demonstrating string concatenation in query fields Setting up a query as a report data source Designing a report layout for product display Adding the Edge browser control to a report Binding the browser control to a query-generated URL Displaying live QR codes in Access reports Customizing QR codes to link to product web pages Testing QR code output and scanning results
|