Example 1b – Collecting the Unprocessed Requisitions
Previously, the command ExecuteReader was used to collect a list of current projects because there was more than one record, along with more than one column. The same command will be used to collect a list of Requisitions by using the PK collected with the project numbers

Referencing Detail 1 above, the ProjectDataSheet table is related to the Requisition table by the PK/FK link. Also, the PK from the ProjectDataSheet was added to a Collection.
Collection: a single-dimensional list. The collection numbering begins with 1. The collection is used on the code side or the handshake. The operator cannot directly access the Collection’s information.
ComboBox a single-dimensional list. Its indexing begins with 0. The ComboBox tool is used on the design side of the handshake with the code. The operator can directly access the Combobox’s information.
The data in the ComboBox is a list of current projects. Parallel with the ComboBox indexing is a Collection where the index starts at 1.
Tool | Index Start |
CheckedListBox | 0 |
Combobox | 0 |
Collection | 1 |
The requisitions are in a CheckedListBox, which has the same indexing as a Combobox. The advantage of a CheckedListBox is the “Check.” In Detail 1, to the right of List of Unprocessed Requisitions is a group of options. Trying not to write a confused block here, there are a few options designed into the checkedlistbox and the options.
cb10_IDCollection(ComboBox10.SelectedIndex + 1)
The above bit of code has the combobox’s selected index incremented by one pointing to the collection cb10_IDCollection. To properly align data programmatically, the combobox index is incremented +1 to point to the corresponding data point in the collection.
- Requisitions can be checked for review. By default, a requisition just needs to be selected to review. The operator can select multiple requisitions to review together by checking (double-click) the checkboxes. Ex., If each requisition is a complete assembly (i.e. an industrial control panel) and only a couple of the control panels are to be ordered per schedule, then the two requisitions can be reviewed together to determine how to order. Possibly all terminal blocks were previously purchased, then the terminal blocks can be zeroed. Note this is not deleted in the requisition as the requisition still requires the material.
- Not shown but available, is another column which holds the “Imported” quantity. The operator can review the requisition and if the ordered quantity verses imported quantity differs, the operator will know the material is still needed but may have been ordered previously or pulled from project surplus components.
- If any quantity of requisitions are to ordered, then the material can be review for Minimum Order Quantities (MOQ). Review blog Speculative Purchasing under menu heading Purchasing.
- Also not shown, is an option to easily manipulate material review by Supplier, Manufacturer, and Model.
- Also not shown, is a pop-up to review the quantities to compare project requirements with project modifications. An example is if previous panels in the project hand MOQ adjustments, then a comparison of need verses have can be quickly determined on additional quantity adjustments.
Collecting the primary key along with the project number permits the primary key to be placed into a collection in the same order as the project number is placed in the combobox. As long as the programmer remembers the indexing offset between the two tools, their use together allows for a quick cross reference. Refer to the database tables in Detail 1.
The automatic collection of requisitions is performed by selecting a project from the ComboBox. The following Combobox handle triggers the routine to collect the requisitions.
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged; End Sub
The above sub SelectedIndexChanged executes by clicking on a selection in the drop-down of the ComboBox. When I started designing the program, there were buttons to manually execute the selection from the ComboBox. After realizing how tedious the process was to select a project then manually request to collect the project’s requestion list, the handle was a convenient tie-in to the process.

Detail 4: Reviewing the module’s parts list and the summary of parts in the complete project.
Jumping back a bit, notice there are options available in the Select Project group box.
All Projects radio button lists every project, current or archived, in the database. Often, a purchase order requires a modification to a line item and the requisition is no longer open. Since the user is singularly focused on a project, the project number is still easy to select from the ComboBox settings options, such as Suggest and Append.

Open Reqs Projects is a special purpose option for quick review of projects being processed towards PO’s. It could be thought, “Why have a Current Projects selection?’. Keeping a list of projects in the head is difficult. After years of working with projects with four characters, all the numbers are meaningless when not associated with a tag. At this writing, there are around 130 active projects. However, at any given time, there are the average of 5 projects being worked on. Since there are five project managers (PM), tagging the PM’s initials to the project number is a good memory aid.
Current Projects are active projects not closed in the accounting software. At this writing, there are more than 200 active projects. Using the Open Reqs Projects, as can be seen, narrows down the choice field considerably and with the PM’s initials attached, selection can be quick.
Detail 7 shows the requisitions associated with project 9264. There are a consider number of options available when working with projects. These options developed over years of developing the program in order to streamline the purchasing routine. The purchasing routine extended into handling the material once received. The receiving program functions single-mindedly as material log-in with specialized options and reporting.

Detail 7’s CheckedListBox of requisitions shows two bits of information. The sequential number on the left (005, 006, …) is the sequential requestion number determined in the SQL select command. The column to the right (7284, 7291, …) is the record number from the database. In the beginning, the requisitions were referenced by the database record number. As the database grew, of course the record number increased. A user is not specifically concerned on how the requisition is titled. In order to make the display visually coherent, the records within the project were eventually sequentially numbered. The record number is hold-over from earlier programming and will eventually be removed. Other functions on the Edit Tab reference the record number, such as moving material to a different requisition or creating a new requisition if some material is not ready to be purchased.
Sometimes, even a complete requisition may need to be moved to another project if an error was created. The format of the company’s projects is strictly numerical and it is easy to guess an incorrect project or misread a project number, like project numbers 9315 and 9351.
Recalling Detail 2 from above, if material is to be moved, the database records are used and not the sequential numeric. The following bit of code
clb2_ReqIDCollection(CheckedListBox2.SelectedIndex + 1)
Just as with the combobox, the CheckedListBox indexing must be increased by +1 to properly align with the data in the collection. Recall, when communicating commands to the database, the PK/FK relationships are used.