Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Templated Form Population Based on Number of Transaction Lines 1

Status
Not open for further replies.

dataman86

Technical User
Oct 11, 2008
104
US
I have a VB Windows Application that I need to add better functionality to. In the Accounting world we have Journal Vouchers that we must do to make adjustments to accounts when errors are made or other problems. I have a Sequel Server 2005 database that holds up to 20 to 30 million transactions which can be pulled by using a Account Period Number, Control Group Number, and Posting Date as Parameters in the application through a GUI Form. There will be times when I pull say a Transaction from the server with Control Group Number 1, Accounting Period 3, and Posting Date say 01/15/09, there might be 12 lines pulled for this particular transaction. Each Line has a Debit or Credit Entry. In the Accounting Application that we use the Credit Entries have a Negative Number, say -10000.87. The Debit Entry will be a Positive Number 10000.87 but will be posted to different number codes within each line. The VB Application that I have created will place the Negative Numbers in the Credit Side and Positive Numbers in the Debit Side. The Debit Entries must always equal the Credit Entries in a Grand Total.

I need to be able to populate a Templated Form for 12 Transactions on one form and have another form pop up with Transaction Lines 13 through 24, then another Templated Form to pop up for 24 through 36 and so on. The number of templated forms poping up would be determined by how many transaction lines you need to hold the data pulled for each Accounting Period, Control Group, and Posting Date. If you
pulled a transaction that had sixty transaction lines you would have the system populate five templated forms automatically to hold the transacted data.

I hope this makes sense. Anyhow, any suggestions would be helpful.

DataMan86
 
Personally, I wouldn't. Why would want to? There a lot of possible factors to think about in this. Things like are you going to have instances where you might pull in 100? A few hundred? How many windows may end up too many windows. Will I have system resource concerns? That aside if you need to compare you are only really comparing two things at a time so why so many windows open at once?

Multiple windows is a nifty thing, but generally logistically not worth the potential headache in the type of situation you are talking about. Though any alternative would depend on why you don't want to work with just 12 at a time.

Still if you really want to do it then first it would be best to go with an Mdi Container and Children windows. Second how to make each window would really depend on how you are pulling in the data. Also you said you already show debits and credits so how are you doing that?

Basically a "template form" is just a normal form, but rather than using .Show or something like that you create an instance of the form.

Code:
Dim nForm As New Form1
nForm.Show()

For an Mdi Container/Child you also set the Parent. So if the code for the form is in the Parent then:

Code:
Dim nForm As New Form1
nForm.MdiParent = Me
nForm.Show()

I hope that helps. If you can give a few more specifics like I said how the data is pulled in and how you already show debits and credits I might be able to help more.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top