Combo Box

Combo Boxes

Combo Boxes are the most fascinating and useful “Controls” you can have on your Form. They have Many uses. Combo Boxes can be manipulated in all sorts of ways without using VBA. Once you’ve mastered the combo-box, and once you have mastered Queries, the building of queries in the query builder grid, a Query you have designed to provide your Combo-Box with a unique set of Records, then it’s a short step to becoming a VBA programmer. One of the most powerful things you can do with VBA is control what your Combo Box does. You can add fantastic and clever features to your Form with minimal VBA, and minimal effort! It is a small stepping stone, on the way to becoming a VBA programmer. The first step, learn the inside outs of Combo Boxes. Learn how to make queries in the query builder grid, and then you will be ready! You will be chomping at the bit to take that Next step into VBA!

Combo Boxes - In the Beginning

The Most Basic Combo Box

Video 1 (4:45)

In this video I show the creation of a very simple combobox. The combobox is unbound and stores it’s values within itself in a “Value List”. I demonstrate creating a combo box both with and without the control wizard. I demonstrate enabling the ability for the user to add new values to the Combobox list. I demonstrate how to stop the user changing values. I demonstrate how you can allow the user to type “Free Text” – anything they like in the combobox.

Video 1 (4:45)

Nifty Access YouTube Thumb Nail

The Following links take you to key places in the video:-

00:30 select a control from the designer tab

00:33 add a combobox with wizard support

00:45 switch the wizard off

00:57 add a combo box without wizard support

01:15 using the wizard; type in the values you want

01:55 the combobox is “unbound”

02:25 allow free typing entries

02:45 set “Limit to List” to Yes

03:00 ask user if they want typed value saved to the list

03:17 shows the item added to the list

03:37 property sheet displaying the values in the “Value List”

03:47 set “Allow Value List Edits” to “NO”

04:12 the “Agile Programming Method”

… …

Get Info From a Combo-box

Get Info From a Combo-box

Video 2 (5:50)

This video shows how to display information from a Combo Box in a text box. Consider a combo box in which you select the customer’s name, then the “After Update Event” causes the address details for that customer to be displayed on the form in text boxes…

Video 2 (5:50)

Nifty Access YouTube Thumb Nail

… …

Form with Combo Box Lookup

Form with Combo Box Lookup

Video 3 (4:56)

Combo boxes are one of the most difficult things to understand. In this video I hope I make them a bit clearer.

Video 3 (4:56)

Nifty Access YouTube Thumb Nail

… …

Cascading Combo Box

Cascading Combo Box

Video 4 (10:19)

This video shows you how to change the Row Source of the “cascade” combo, with an SQL Statement and the after update event of the Selection combobox

Video 4 (10:19)

Nifty Access YouTube Thumb Nail

… …

Combobox - Change Query Criteria

Change Query Criteria with a Combobox

Video 5 (12:26) - 4-Min Excerpt

Demonstration of how to set up a Combo-box and a subform. This demonstration uses the older version of the Northwind Database. The Combo is Shown restricting the records displayed in the subform. This method utilises the Query that the subform is based on. The Selection in the Combo Box provides the Criteria for the Query.  This method requires the Subform/Subreport Control be refreshed, the method employed is demonstrated in the video.. Nifty Access is Here to  help Establish you as the “Go To” person in your organisation for database improvements! Nifty Access – will quickly elevate you to “Power User Level!”

Video 5 (12:26) - 4-Min Excerpt

Nifty Access YouTube Thumb Nail

More Info on th Northwind Sample dB:-

… …

Combobox - Displaying a Number?

Combobox - Displaying a Number?

Video 6 (7:17) - 5-Min Excerpt

Your combobox is displaying a number instead of text? In this video I demonstrate one way you can fix this problem…

I recently answered a question on Access World Forums HERE:- Report only shows Combo box primary key instead of text — I referred the OP to this web page, and Video No# 6. I also so wrote a text explanation on AWF, and I have copied it here because I think it will prove useful to anyone with similar problem. In Video No# 6, I demonstrate this technique on a combo box on a form. However, the Access World Forums (AWF) Question was the same problem, but on a report. The solution is the same, the Report ComboBox needs to reference the information in the Customer table by changing the Combo’s properties slightly… The following is my text explanation to accompany the video explanation:-

Video 6 (7:17) - 5-Min Excerpt

Nifty Access YouTube Thumb Nail

Combobox - Displaying a Number?

Good practice is to store information in the smallest possible format. This is normally achieved by storing "repeating information" in a table. Each row in the table is identified by a unique identity an "ID field"… For example you could have a table which stores customer information, it might store:- salutation; surname; first name; address; telephone number. Each row of "information" would have a unique ID. 

When you want to use this information somewhere else, let's say you want to provide the customer details for an orders table, in the orders table you only need one field to identify the customer. You store the ID from the customer table in this field. But that's not a very user friendly method because the user is never going to know which customer any particular number refers to. This is easily solved by using a combo-box as effectively a up look-up agent.

When you create your "Orders Form" based on your orders table, it will very likely create a text-box for the customer field. As suggested this text box will just display the number relating to the customer. However if you change this text box into a combo box, you can do this by right clicking on it, then selecting the third option in the list "Change To" now you have a combo box. It's always a good idea to follow a naming convention so immediately find the combo box name in the property sheet under the tab "Other" and prefix it with "cbo".

Also the Combo Box default name might not mean much, and may contain spaces. Remove the spaces and rename it something meaningful to your programming processes. Now whilst you've got the property sheet open, select the data tab, select the ellipsis (…) at the end of the "Row Source" property and you will be taken to the query building tool. Select a Table, in this case you want the Customers Table. Select the customer ID field and the customer name field so they appear next to each other in the query builder grid. You need a minimum of two Fields, the ID field and the customer name field. You may want other Fields, for instance you may have a Boolean field to flag a discontinued customer. Select this field and set the criteria option to "False". Now discontinued customers will not show in your results. You don't want to see the "Boolean field" in the combo-box so make sure the "Show" checkbox is unchecked.

Close the query builder Grid and re-open the property sheet for the combo-box as we've got just a couple more things to check/set-up. On the data tab make sure that the "bound column" property is set to 1 and "limit to list" is set to true (Yes)… Select the format tab and set the column count property to 2, and the column widths property add the Text "0, 2" … 

The "bound column" is the column where the data from the combo box will be taken and fed back into your orders table, and you want the customer ID which will be bound column 1, the first, the left most part of the SQL/Query, in this case the ID. The column width property of the Combo Box is a way of specifying what actually appears in the actual combo-box, is Visible, is what the user sees. In this case we have have query which returns two columns, the ID and the customer name. But we don't want to see the ID, we just want to see the customer name. To do this set the "column widths" to 0; 2 — This shows Nothing of the ID, but 2cm of the customer name. Some versions of MS Access will not show centimetres but inches so the figures might be slightly different for your version of MS Access.

There are several other properties you can change for a combobox, however these property's I have explain here are the basics and you will seldom find yourself changing anything else….

… …

Advanced Combo Box Techniques - by Mike Wolfe

Advanced Combo Box Techniques - by Mike Wolfe

Video 7 (54:30)

The Microsoft Access combo box control can display a list of options, enable/disable AutoComplete to reduce keystrokes that are necessary to choose options and enter data quickly, and a way to select hidden data. It’s optimized for key board and mouse, and promotes discovery and efficiency; the techniques demonstrated boost these 2 key objectives. Combo BoxApalooza Advanced Combo Box Techniques by Mike Wolfe ( www.NoLongetSet.com ) 18 June 2021, Friday

… …

Combobox - Show Country & Region

Combobox - Country & Region

This DOWNLOAD example is in answer to a particular Question on Access World Forums (AWF) – The OP wanted to enter the name of a country into a text-box on an MS Access Form and then have a combo-box to display the continent/region? related to that selection. I suggested an alternative method, using a combo box to select only the Country and have the continent/region extracted from the ComboBox and displayed in a text box. I used a data-set I downloaded (Excel Format) from the internet to create the entries in the table for this MS Access demonstration from this URL here:- Statvision The information for the Microsoft Excel file was created from information provided by this website here:- gsociology.icaap.org You can download the MS Access example from the Nifty Access Digital Downloads Website here:- Country / Region Combo Box Example.

… …

More Useful Stuff HERE:-

Advanced Message Box

“Advanced” Message Box

Message boxes can be modified quite extensively to give you your user a much better experience. So before you set about creating a Form to use as a Messsage Box, consider using the more advanced features of a “Built In” Message Box.

There’s a really nicely done example database on message boxes from Colin on  Access World Forums here:- An Attention Seeking Database

Extract:-

Features include various ways of creating messages to get users’ attention including:
1. Formatted message boxes
2. Customised message boxes with HTML formatting & countdown timer
3. Flashing, scrolling and balloon tooltip text 
4. Dim / blur / remove background
5. Adding warning sounds (use speakers if possible)

“Advanced” Message Box - Walk Through

“Advanced” Message Box - Walk Through

Video 1  (8:06)

Message boxes have some advanced features which you may or may not be aware of. In this video I demonstrate some of these advanced features. In the video I mention an old programming technique. I believe I happened across the term for it today, and the term is “Bit-wise Comparison” You can see my non-explanation of it here at time index:- https://youtu.be/f1tDWoKOkek?t=4m31s

… …

“Advanced” Message Box 2

“Advanced” Message Box 2

Video 2 (3:43)

In this follow-up video from my first Advanced Message Box Video, I demonstrate the code working in The “Nifty Switchboard Builder”. I go through what’s happening demonstrating the code actually controlling events, and explain how it’s doing it. I have also provided a code example of the Message Box Code working in a sample database. Download the code by clicking on the link below.

Video 2 (3:43)

Nifty Access YouTube Thumb Nail

… …

“Advanced” Message Box 3

“Advanced” Message Box 3

Video 3 (8:06)

I wanted to delete a Menu Page in my “Nifty Switchboard Builder”. The Switchboard Builder helps you build a menu system for your MS Access database. It’s based on the original Microsoft switchboard builder, but I have added some extra features, and made it a lot easier to use! I needed to check that the user was sure that they were ready to delete a menu page and understood the implications. I also didn’t want them to be able to delete the “Main Menu” the “Master Menu Page” because this would cause all sorts of complications. I realise that the “Advanced Message Box Code” would just drop in and allow me to quickly and easily create a pop-up message box and help the user in making the correct decision. I also had two, different user cases to solve, one was calling the code from a button on the form and the other one was calling the code on a pop-up form, both common MS Access User Case scenarios. I recorded the generation of the code and my thoughts about my decisions in creating the code in the YouTube videos ABOVE which should help anyone who wants to undertake the same task in their own database. The code is also available for free in text format at the bottom of this web-page.

Video 3 (8:06)

Nifty Access YouTube Thumb Nail

… …

Example of the MsgBox Code

I have recently updated the sample message box code (SEE BELOW) to reflect an actual real world example. It’s not quite the same as the code shown in Video 1 ABOVE. There are now THREE Videos Demoing the Advanced Message Box. I have also packaged the code shown in that video in a Sample Database which you can download by clicking on the download links above. It contains TWO working examples of the “Advanced Message Box Code” in use. The Code is based on the “Nifty Switchboard Builder”. The Switchboard Builder allows you to create a new Switchboard Page, the Switchboard Page will have a default name, however this Message Box offers the user the option to change the default name to something else, or to leave it as the default name and escape from the process without making any changes.

“Advanced” Message Box -Code Example

				
					Private Sub btnGo_Click()
If txtNewPageName = "" Or IsNull(Me.txtNewPageName) Then
    Me.txtNewPageName = "Default New Page Name"
End If

    If txtNewPageName = "Default New Page Name" Then

            Dim strMsg1 As String
            Dim strYes As String
            Dim strNo As String
            Dim strCancel As String
            Dim strTitle As String

            strMsg1 = "Do You Want Change Default Page Name, to Something Meaningful?"
            strYes = "  Yes:          Return to the Textbox. I will Create my own Name"
            strNo = "  No:          Just Use the Default Please"
            strCancel = "  Cancel:    It's Bloody Confusing, I'll Just Play it Safe for Now"
            strTitle = conAppName & " --- Change Default Page Name?"

                Select Case MsgBox(strMsg1 & vbCrLf & vbLf & strYes & vbCrLf & strNo & vbCrLf & strCancel & vbCrLf, vbYesNoCancel + vbQuestion, strTitle)
                    Case vbYes:
                        Me.txtNewPageName = ""
                        Me.txtNewPageName.SetFocus
                    Case vbNo:
                        Call fAddNewPage
                        DoCmd.Close acForm, Me.Name
                    Case vbCancel:
                        DoCmd.Close acForm, Me.Name
                    Case Else: 'Default case to trap any errors
                        'Do nothing
                        MsgBox "Error From --- Select Case in btnGo_Click"
                End Select
    Else
        Call fAddNewPage
        DoCmd.Close acForm, Me.Name

    End If
End Sub      'btnGo_Click
				
			

More Useful Stuff HERE:-

Searching for Answers

Searching For Answers

The upgrade to the Access World Forums (AWF) has also provided a much better search facility. So this blog is practically obsolete! However, I still find that the Google Search offers a much greater control over what you are searching for. If you’re trying to find something obscure, give it a try, compare the two searches the forum Search and the Google Search; let me know what you find!

Searching For Answers

Searching For Answers

Video 1 (1:27)

Did you know that you can use Google to search Access World Forums and get a more refined result?

I find that the search facility provided  by vBulletin forum software is excellent at searching for single words. However it does not provide the sophistication of tools like Google for searching for exact phrases.

To get this sophistication Click on the GREEN BUTTON BELOW:-

What to do when you are stuck! Occasionally you can get stuck in your MS Access Project and don’t know how to proceed.. We all get stuck from time to time and it’s a big problem; but when you’re starting out it’s an even bigger problem, because it’s so difficult to find what you want… Just searching the Internet willy-nilly can return you frustrating and confusing results. Therefore I suggest you use the advanced features of Google Search (See the video on this page or click on the green button!) and target that search at a specific knowledge Site, one that has a far higher chance of answering the question you are searching for an answer to.. It’s actually quite easy when you know how.

However, it’s not always as simple as searching, especially when you are new to MS Access. You don’t always know what to search for, you have an idea, but your search is not returning any sensible results. This is not unusual, this happens because of the way you are asking the question. It’s unavoidable, because if you don’t know the correct term to search for then you’re going to get incorrect search results… What can you do? Join the forum!!! Sign up!!! A very simple process. Then ask, just say:- I’ve got this problem, I’ve searched for this, that and the other, but I’m not getting anything back which is useful can anybody advise me…..

Video 1 (1:27)

Searching For Answers

Nifty Access YouTube Thumb Nail

… …

More Useful Stuff HERE:-

Update Excel from MS Access

ExcelADOAccess

Update Excel from MS Access

Before I found Bob’s excellent code on the BTAB Development Web Site… (To see it Click The Button Below) … I relied on the two links from Microsoft which you can find below.

One link demonstrates the automation method to transfer data cell by cell, which is fine for small amount of data. For lots of data, use the CopyFromRecordset method as it is more efficient.

Update Excel ADO

Update Excel from MS Access

Image 1

Someone asked:- How to update Excel from MS Access? (Access World Forums) 

This question reminded me that I had a couple of excellent links hidden away, a couple of links to Microsoft Support where they provide two excellent articles on how to do this. I thought I would share the links with you!

Methods for transferring data to Excel from Visual Basic

How to transfer data from an ADO Recordset to Excel with automation

Image 1

… …

More Useful Stuff HERE:-

Attach a Label

Attach a Label

Attach a missing label – Nifty Access – The problem you are facing is, you’ve got a Control and it’s missing its Label. To duplicate the situation, first create a Textbox on an MS Access Form. Created a text box with a label. When you move the text box, the Label moves with it.

Attach a Missing Label

You Deleted the Label - And Now Want it Back!

Video 1 (0:52)

However for some reason you decide you no longer need the label and you delete it. A few hours later you realise you made a mistake and think to yourself “Damn! I wish I hadn’t done that” You try and fix the problem by creating a new label, however The first problem is the label won’t stay there! It vanishes! You can solve that problem by entering the label and pressing a dot, or any text really. You’ve added a caption in the label and it will stay. But although the New Label is adjacent to your text box, it won’t move with the Textbox, it’s not fixed, not attached to it. What you do is you click on the label do:- “Cut” then click on the text box and do “Paste”. Now your label is reattached to your text box…..

Video 1 (0:52)

Nifty Access YouTube Thumb Nail

See the video Above:- Video 1 (0:52) for a demonstration of the problem and how to fix it.

More Label Posts

Vertical Text in a Label

Explanation of how to display text vertically in a label and textbox here:-

Vertical Text in Label and TextBox

Find Caption of Label

Getting the caption of a text box label is not straightforward, I explain it here

Find The Caption of a Label Attached to a Textbox

… …

More Useful Stuff HERE:-

Control Records Displayed in a Subform

Control Records Displayed in Subform

There are various ways you can display how records are sorted in a Form. I’m fond of directly accessing a forms record source with an SQL Statement, an alternative would be to use the filter property.

I have done a few videos on the filter property which you could probably find by searching my YouTube channel.

This blog would benefit from a duplicate example, an example, basically the same as this SQL – RecordSource method, but instead use a Filter.

If you want to see such an example then please add a message in the YouTube Comments. If I get enough interest I’ll get I’ll get and make one! Don’t forget to sign up up to receive news and updates from me over on the right.>

Control Records - In Answer to AWF OP

Control Records - In Answer to AWF OP

Video 1 (5:18)

Klingest Asked — What I want to do is, that when you select a record in the subform showing “tblCalculation”, the related values from “tblSubCalculation” shall be displayed in the other subform. 

How can I do that?

In this video I answer Klingest’s question. I demonstrate how to capture the record selected (with VBA) in the first subform, extract the record’s ID, then insert the ID into an SQL Statement, again, with VBA Coding.

Next I show how to insert the SQL Statement into the Recordsource of the Form contained in the subform. (Subform Window)… You can see in the YouTube Video that the second subform now displays the related records, the records that match the selected record ID number in the first subform…

The VBA code used in the video is available:- Click on the button below:-

I'm always grateful for any contribution, what better way to tell me that what I'm doing is worthwhile. As an alternative, you could sign up to my YouTube channel.  Signing up to my YouTube channel  helped me immensely because when I get to 1000 users I get an upgrade in my YouTube account!

Video 1 (5:18)

Nifty Access YouTube Thumb Nail

… …

More Useful Stuff HERE:-

Barcodes





Nifty Access Barcode Pagex

Nifty Access Barcodes

Barcodes

Bar-codes along with a bar-code scanner can be a very useful feature to add to your database.

You can quickly scan in serial numbers from mass deliveries of items / components. Bar codes are also very handy for managing the repair process of an item returned for repair. For example, by recording a repaired item’s serial number, you can retrieve useful information like how many times the item has been returned.

BARCODE’s are very easy to add to your MS Access Database. You can add a barcode font, See “Access All In One” Video 2 (5:41) Below, and wherever the bar-code number appears, it will automatically be replaced with a barcode.

The Barcode scanners themselves plug directly into your USB port, no setup, away you go! They work just like a keyboard. Here’s a Wireless Example.

Barcode Scan – Demo

Video 1 (01:19)

In this video I’m testing barcode input for a till system (point of sale system). Notice that if you scan the product barcode a number of times, it updates the number of products the customer has purchased.

I went further with the development and added the facility for removing a product in cases where a product was accidentally scanned in.

Play Video

Barcodes – MS Access – (Northwind)

Video 2 (5:41)

This is an excellent video here from “Access All In One” – Hacking Northwind 01 – Using Barcodes In Access.

See my video VBA Beginner – Setup the Northwind dB – Nifty Access, which provides instructions on how to install the “Northwind Traders” sample database from Microsoft.

© 2024 Nifty Access


Normalization Tool

Transpose Tool Header Image

Normalization Tool

Introducing the “Transpose Tool” or “Database Normalization Tool,” your go-to solution for seamlessly converting spreadsheet-structured data into MS Access-structured data. This transformation not only equips you to construct exceptionally powerful MS Access databases, but is also a critical process exclusive to power users—those with an adept understanding of MS Access, often regarded as problem-solvers within an organization. If that’s you, you’re likely familiar with this technique. This tool aims to streamline and enhance the process, offering you a smoother experience!

If you happened on this page perchance and are wondering what it’s all about, then I suggest you have a look at these links.

Normalisation tool in Action

Excel in Access - Transpose YEARS

Video 1 (4:38)

I created this video in answer to the question in this thread. Query for years of service  — Basically the table resembles an Excel Spreadsheet. This columnar Data is not ideal for MS Access.The solution is to transpose the Excel like table into a new table, in a format suitable for MS Access. You can download the tool “Transpose Tool” from — Nifty Access” – press the download button below.

Video 1 (4:38)

Nifty Access YouTube Thumb Nail

… …

Build Query Heads 1

Build Query Heads 1

Video 2 (4:24)

In this first video, I demonstrate how to normalise some data imported from Excel. This consists of breaking it up into 3 separate tables. I then demonstrate how this normalised data can be drawn back together again into a useful and usable table. I then demonstrate how to use a cross-tab query to produce a particular output required.

Video 2 (4:24)

Nifty Access YouTube Thumb Nail

In answer to an OP question on AWF Here:-

… …

Build Query Heads 2

Build Query Heads 2

Video 3 (10:05)

The form “frmTranspose” (shown in the video) is available from my website CLICK HERE with further information on issues. It is very handy for turning denormalized data into normalised data for use in MS Access.

A precursor to this video is above, See Video 1. It can also be found on YouTube here:- Build Query Heads – Nifty Access where I do a presentation showing how to convert the data imported from a spreadsheet into data suitable for MS Access.

Video 3 (10:05)

Nifty Access YouTube Thumb Nail

In answer to an OP question on AWF Here:-

… …

Transpose Excel to Access

Transpose Excel to Access

Video 4 (11:11)

OP rasras123 ask a question on Access World Forums (AWF) which indicated that the table structures being used were not optimised for MS Access. In answer to the question I created a table in the unoptimised format as indicated by the OP, and used my Transposition Tool to convert the the unoptimized table into 3 tables, suitable for taking advantage of the advanced features of MS Access. As indicated by MajP, there is an alternative the OP could use which is also shown in the thread.

Video 4 (11:11)

Nifty Access YouTube Thumb Nail

Original Question on Access World Forums (AWF)

… …

Filter Fleet City to Return Rate

Filter Fleet City to Return Rate

Video 5 (5:41)

Our tool provides an insightful example, showcasing how to utilize the optimized database. This tutorial demonstrates how to answer a specific question, as illustrated in the third video: “Filter Fleet City to Return Rate.” This video answers the original poster’s question, leveraging the improved structure (see YouTube: Nifty Access – Transpose Excel to Access).

By separating elements like City and Fleet, these items can be looked up in combo boxes and the resulting data can be used to perform the required search. At first glance, transforming a simple Excel table into a more complex three-table system might seem counterintuitive, and perhaps like a great deal of work for minimal return. However, the benefits are immediately apparent. Opting for an unoptimized, un-normalized route is simply not the most efficient path.

The advantages and future simplicity your database offers far outweigh the initial extra effort. If you bypass this restructuring process when transitioning from Excel to MS Access, you might find tasks becoming increasingly challenging, eventually to the point where obtaining the desired results with a de-normalized structure becomes impossible.

The bottom line is, if you’re building anything beyond the simplest of databases, this step is non-negotiable. If you’re managing only a very simple database, MS Access may not be necessary—you might consider sticking with Excel. But for more complex tasks, our tool is here to simplify and improve your MS Access experience.

Video 5 (5:41)

Nifty Access YouTube Thumb Nail

Original Question on Access World Forums (AWF)

… …

Using the Tool - In Pictures

ALL Controls are Disabled ......

Image 1

When you first open the Form all of the controls are disabled, except for the first Combobox. 

Image 1

Select the Table

Image 2

Select the table you want to transpose data from. Note:- the combobox only shows tables with names prefixed “Xtbl”

Image 2

Select the Unique "ID" Field

Image 3

Select the field which represents the “Records” unique identity. This integer will enable you to link all of your tables back together again, and  display the data in the original format. You might be wondering why you have to go through this awkward process, however as you can see in the above video, the benefits in the simplicity of creating your queries, reports and everything else you want to use/do with the data far out way this small Inconvenience, particularly if you catch it early enough in your database development.

Image 3

Select the Fields from the Listbox

Image 4

Selecting the unique “ID” triggers the list box to fill with names of the fields from the table. Select the fields that you want to be transposed from the old table into the new table

Image 4

Select the Table to Transpose to

Image 5

The names of tables prefixed with “Ytbl” will appear in this combobox select the table you want the data to be transposed into from this combobox.

Image 5

Select the Field to store the ID

Image 6

Now select the field that stores the record ID that matches the new table to the original Table

Image 6

Choose a two, or more column Table

Image 7

You can copy the data to a two column table or 3 columns, in a table with more than two columns. A two column table would be for storing Data directly related to the field name. Where the field name identified the data, for instance a “true or false” situation like “Order Completed”

Image 7

Two or Three Column Solution

Image 8

In this case you have selected the three columns solution. This means you have a column for the ID; a column for the field name and column for the Data. The field name “conveys information” like in the example video above, the field name conveys the information “the year” and then whether the person was an active volunteer in that year.. “The Data”

Image 8

Select the Field for the the Data

Image 9

Again you are using the three columns solution. So now you need to select the field where you want the data to be placed. In this case, see again the example video above; the Data is whether the person was a volunteer for that particular year or they abstained.

Image 9

Press "ONLY ONCE!"

Image 10

All of the necessary selections have been made. You just need to press the button to complete the process of filling the table. Don’t press the button more than once otherwise you will double or triplicate the data placed in it.

Image 10

This Tool  helps convert a flat file MS Excel spreadsheet into a Relational set of Tables more suitable for use in MS Access. Looking back through my notes I realised that this was the original thread that got me started on creating the Transpose Tool – Split one table into 2 (relational) ones

If you have any problems using this form, of if you have a data set that you think should transpose but you’re not sure how to do it, give me a call…..

Cheers Tony…

 

Date …………… Views
2010_08_23 … 516
2010_08_24 … 551
2010_08_25 … 576
2011_02_19 … 824
2011_10_19 … 1476

… …

More Useful Stuff HERE:-

Option Group Label Color Change

Option Group Label Color Change

The technique employed in this sample is well worth learning and applying in your own MS Access database. There's always a gotcha when you are developing new code, and I hit one when I was trying to build this.

I wrote the code to change the label colours, but it didn't work? It turned out "IT WAS WORKING" but the background colour of the label was set to "TRANSPARENT" Therefore I couldn't see the colours change.

This is why you have to do coding yourself, this is why you have to push yourself and try new things, because YOU WILL come up against brick walls, BUT once you've pushed through the brick wall you know something new, you improve, and you become a better programmer.

Option Group Label - Video & Download

Option Group Label Color Change

Video 1 (7:17)

This video demonstrates a code module which allows you to change the colour of the selected option group label, and optionally collect the caption of the selected label.

The code module is generic, it will work for any option group containing any number of labels (within MS access limits) and will change the colour of the selected option group label, you could also modify the code to change the other features of the label, like the border colour, border style, text style, font size, any attribute which is modifiable in VBA code.

You can obtain the “Option Group Label Color Change” Here:-

Video 1 (7:17)

Nifty Access YouTube Thumb Nail

… …

More Useful Stuff HERE:-

Open one Form from Another and transfer Data

Passing Form Values

A common requirement is to pass values from one form to another. In these videos I demonstrate some problems you might face, and demonstrate a good and robust way of doing it.

Open One Form From Another

Open One Form From Another

Video 1 (3:15)

have used the technique shown here, for many years. I find it is very flexible, also, quick and easy to copy from one Form to another.

In the sample database I use this code:-

				
					Private Sub btnOpenForm2_Click()
Dim strFrmName As String
strFrmName = "Form2"
    
    DoCmd.OpenForm strFrmName
        With Forms(strFrmName)
           '.btnOnForm2.Enabled = True
           '.fSetUp ("Sample Parameter")
           '.Caption = "I CAN CHANGE THE CAPTION"
        End With

End Sub
				
			

… to open the form and directly and access the properties of the command button.

I have deliberately left items (the commented out lines) in the code so you can get an idea of what’s possible by using this method.

For example this line here ‘.fSetUp  calls the function “fSetUp” which is a public function within the form you are opening.  If you un comment that line it will calls a function and you can see how it works.

This is a very powerful way of controlling what happens when you open another form….

You can also provide function parameters which provide one method of Passing values through to the form you are opening…

Video 1 (3:15)

Nifty Access YouTube Thumb Nail

Related Links:-

Tags to help me find this piece of code:-

#With End With #Open Form #OpenForm #fSetUp

… …

Form Load, Activate, Open, Issue 

Form Load, Activate, Open, Issue 

Video 2  (3:58)

Video 2  (3:58)

Nifty Access YouTube Thumb Nail

… …

Form Values passed to Controls 

Form Values passed to Controls 

Video 3 (1:22)

Video 3  (1:22)

Nifty Access YouTube Thumb Nail

… …

MORE - On the Form Load Issue 

The Form Load Issue  

Video 4 (2:00) Approx!

This video, from my YouTube Playlist:-

Object Oriented – Nifty Access

Explores creating a Class Module and how to use it with Allen Browne’s Calendar Form… However Allen Browne’s Calendar Form can be set up and used as is, you don’t need the Class Module, unless you want access to the advanced features the Class Module provides.

Follow the instructions on Allen Browne’s website – Popup Calendar HERE:-

http://allenbrowne.com/ser-51.html

I have created my own Calendar Control/Form, The:-

Nifty Date Picker

The NIFTY DATE PICKER has the distinct advantage that it’s very customisable. More Here:- 

Nifty Date Picker for ALL Versions of Access – Nifty Access

Colin’s Date Picker which in my opinion is very slick looking, (I’m jealous!) is HERE:-

A better Date Picker

Video 4 (2:00) Approx!

Nifty Access YouTube Thumb Nail

… …

PopUp Form - Pass Data Back

PopUp Form - Pass Data Back

Video 4 (7:57)

In this video I demonstrate calling a pop-up form, extracting a row number from a subform in datasheet view on the form. I demonstrate how to extract text from the same subform. I suggest t’s a good idea to start using the “Value” of property. I explained how to pass the value by making a copy of the textbox. I passed that to the Pop-Up form. Then, add a custom property and pass the data into the custom property. I use the “With” – “End With” Block to bracket the code that operates on the form.

Video 4 (7:57)

Nifty Access YouTube Thumb Nail

… …

Call Called Class

Call Called Class

Video 5 (9:44)

This was one of my early videos on “Call Calling” Class. As with most projects your code starts out with the goal of solving one particular problem. As you progress, you realise your idea can be applied more generally. I recently updated this Class Module . It was originally based on the Microsoft active X calendar control.

See YouTube playlist here:- Object Oriented – Nifty Access

Video 5 (9:44)

Nifty Access YouTube Thumb Nail

… …

More Useful Stuff HERE:-

This website uses third-party software - WordPress Add-Ins to be exact. I don't know what any individual add-in does, but I'm sure that many of them collect information about you. So be aware, if you continue using this site, then you are likely to be sharing your information. I don't know how to disable this sharing for any, or all of the plugins for individual users. So I can't stop the sharing of information. If this worries you then please do not use this site... If you continue to use this site I will assume that you are happy with it.

Do you need a hand in the right direction?

You are in the right place.