Some continues forms examples
Virtually anytime you need some type of data grid, you can use either a Listbox, or a continues form.
A listbox is most useful when you don't need to edit the data or need ANY SPECIAL controls or formatting.
The following screen gives an idea:
If you look closely, the user has typed in "pr" in the search box. The search results are displayed in a grid. Any Group Name or Company or LastName that starts with Pr is displayed. Of course, I need a grid display. That list of company matches is a simple list box. One of great things about ms-access is that our listboxs allow multi-column. A remarkable simple control and you can shove sql right into the list box and not even have to build a connection object. (gosh...we are just so spoiled in ms-access). Of course for each company shown, I wanted to show some past history. This past history (past trips) is shown in a grid on the right side. Thus, we get a real nice drill down, and we don't use some kluge combo box on a combo box (I hate those anyway!). Not only is the above user friendly, but is also bandwidth friendly also. The above pulls a MINIMUM of records across the network. Thus, with very small files in the 50,000 record range, the above responds instantly, and we are using JET in a file share. I have yet to see the above screen slow down (mind you, I only have 5 users and those small tables...but my point is that well written software absolute screams on a small network with such small tables).
The grid on the right side with the detail drill down is actually a continues sub form. The reason why I did not use a list box on the right side is because I wanted to show the "check" box control. Further, the other main difference is that sub-forms allow you to EDIT the data. The list box on the left thus cannot be edited...but on the right, I can allow editing of data. Furthermore, this allowing of editing takes NO additional code!
Note that if the user moves the up or down arrow, then the list on the right side changes. Hitting the up arrow a few times would result in:
The real beauty of continues forms is that you can have controls repeat. This is somewhat similar to control arrays, and cloned controls in VB, but is much better since the controls ARE DATA BOUND for you! (Actually, in VB you use the data repeater control). Once you stuff the sql into the control, no additional coding is required for editing of data! Also note in the above how I used a combo box to let the user select the type of search. The other search options are phone number, and email name. By using a combo box, I can actually add more searching options, and not have to re-code the screen.
Here is another example of a search screen with a continuous sub-form:
Note how I added a little "glasses" button. When the glasses are clicked on, the details for the record are displayed. What is neat about the above is again how controls are "repeated" for you. You can make some neat screens as a result. You can also use stuff like conditional formatting to shade the screens like:
I actually did not like the above shading so I removed it before putting the above code into production. However, again note the repeating button. Since each field is a regular text box, then stuff like data formatting etc is possible for each column (the phone number field, and the above date field is a great example. All of the VERY rich formatting options for a text box work equally well in the continuous forms. Again, these formatting options take no code, and no code was written to "load" up each row of the above grid. All we do is supply the sql string, and then ms-access does all the magic. And what data grid allows you formatting like the above without any code?
What is truly amazing is all the time you spend learning to design and build and write code for forms applies EXACTLY THE SAME to the above form. In other words, you don't have to go out and learn another complex object, as the forms object is the one you know the best already, and use every day! These screens are plain Jane ms-access forms with NO special controls added. You design and build these forms like any other simple easy to make ms-access form. The only difference here is you then switch the form into what is called continuous view, and presto the controls all repeat for you automatically. Even more impressive is that you are NOT restricted to a single line of details! The fact that these forms are just regular ms-access forms with no special controls or code makes ms-access such a cool development environment. Since continues forms use regular controls, then you can build screens like the following:
Again, you can see the incredible flexibility we get. Note the use of combo box, check box, and buttons to launch more details forms. Note how even some fields are shaded out. All of these features work EXACTLY the same as when you built a regular form. All of Visual basic code your write for each event etc still works in the above screen. Even more incredible is that NO CODE IS NEEDED TO ACTUALLY EDIT the data! I used the regular forms creator for the above and simply dragged and dropped the controls (combo, text box etc) on to the form, and I was done!
Data editing is 100% handled by ms-access for you. In the above, ZERO LINES of code was written to edit the data.
And, we not restricted to one line of detail. I can take the above controls, drag + drop, and make each record on two line of code
(the above is ugly, but we have incredible flexibility since any control placed on the form will repeat over and over)
And people wonder why ms-access builds applications in 1/3 the time it takes in VB? Try building the above screen in VB and see how long it takes you. (good luck!). (hint...you need to use the data repeater control in VB. The data repeater control is still WAY more work! Further, unlike ms-access forms, the VB data repeater control does not handle the parent to child relationships for you like ms-access sub forms do!).
Here is a classic example of a form that splits out funds, here we used two sub-forms to make two grids, and again the development time, and amount of code is very small.
My article on sub-forms in ms-access is here: Sub-Forms in ms-access
Some more screen shots of ms-access:
Searching for names in ms-access
Report prompt screens
My MS-Access page