Microsoft
Software
Hardware
Network
Question : Table structure for tracking an annual budget with monthly input for each field on one form. Is there a better way than what I have done?
I am in the process of building a budget tracking database for a chain of cafes. A requirement of the database is to be able to input the budget for the entire year on one form. The way i currently have the database structured is clumsy and hard to make revisions to because of the 255 field limit for ms access tables. I pasted an example of how i want the form laid out below. The main form pulls from tblStore where StoreID has a one to many relationship with tblBudget. tblBudget however has all 255 fields used which makes me uncomfortable. The naming scheme for the fields in tblBudget goes as follows: Month Number - Fieldname eg. 01-AvgDailyCash, 02-DailyCash, 03-DailyCash...
i have tried unsucessfully to split each months data into its own table and be able to pull up the information on one form based on Store ID then budget year.
Is there a way i can setup relationships that would allowme to circumvent the query field limit of 255 as well and display all the information to be entered on one form? Please comment with any questions.
p.s. some of the fields listed below are just calculated fields and are not stored in the table.
Store Name:Cafe100 Store ID:1
Budget year: 2006 january February March April May June July.......
avg. daily cash sales
average charge sales
operating days
holidays (paid)
Revenues
Cash
Charge
Other
Total Revenus
Cost of Goods
Food 42%
Paper 6%
Other
Total Cost of Goods
Labor
Wages
Payroll Fringes 30%
Other
Total Labor
Other Operating Exp.
Newspapers
Cash Over/Short
Laundry
Kitchen Supplies
Signage & Displays
Repairs
Utilities / Phone
Auto Travel
Entertainment
Equipment Rental
Office Supplies
License, Permits, Fees
Bank Charges
Insurance - General
Misc.
Total Other Oper. Exp
Total All Expenses
Operating P or (L)
Answer : Table structure for tracking an annual budget with monthly input for each field on one form. Is there a better way than what I have done?
Joe,
OK, You will need to add Year as a column in the in the Budget table
Use combo boxes for Year and Store on the main form. In the Before Update event for these call a routine that checks whether there are rows in the budget table for the store/year combination. If not, insert them using the Budget Lines Description table as the source. Something like this:
Private Sub cbStoreID_BeforeUpdate(Can
cel As Integer)
InitBudget
End Sub
Private Sub cbYear_BeforeUpdate(Cancel
As Integer)
InitBudget
End Sub
Sub InitBudget()
If Nz(Me.cbStoreID, 0) = 0 Or Nz(Me.cbYear, 0) = 0 Then
Exit Sub
End If
If DCount("BudgetLineID", "Budget", "Year=" & Me.cbYear & " and StoreId=" & Me.cbStoreID) = 0 Then
' Put the code to insert the budget lines here
End If
End Sub
Each of the tabs would contain a separate sub-form with a record source selecting the appropriate budget section and connected to the storeID and Year combo boxes via the parent/child properties.
Random Solutions
white cross, selecting, highlighting
Recycle bin corrupted
Backup Exec and Overwritable Media
Upgrading addresslists and recepient policies in Exchange 2007
comparing two tables based on two identical fields
String or binary data would be truncated?
Merge or compare excel sheets
OWA attempt returns Internet Explorer cannot display the webpage
C drive shows as 13.4GB used, but adding folders is 11.7GB
block/unblock the IP in Windows Firewall?