
Originally Posted by
Richard Buttrey
Hi,
The first question I'd ask is what are your reasons for creating two data tables. Why not create a single database which will be more flexible, particularly if you want to use a Pivot Table for any subsequent analysis.
Just add an extra column to record the category of transaction. i.e. Income or Expenditure. Hence your database columns would be
Date
Category
Type
Quantity
Amount
Total
Notes
The next point is do you really want to clutter up your user form with separate boxes for each Type. The only conceivable reason for doing this might be if any one transaction consisted of more than one type. In any case I'd still only have a userform which contained boxes for the fields I mention above.
And if this is a form merely for capturing data records, do you really want the Grand Profit, Tax & Net Profit since these are presumably outworkings of the data you capture and can be calculated in the background. In any case you don't appear to be recording the GP Tax & NP anywhere in the database.
Finally I'd just ask whether you really need a User Form. Personally when I build data capture macros like this I create a 'new record' row of cells above the database into which the user enters the various values. Then a 'Submit' button macro merely adds a new top line to the database, copies the new record row and pastes it as values to the newly introduced row.
Bookmarks