Haha
Okay, first this is a point of sale system + membership system + invoiceing system. A little more than the order entry system I had first thought.
To do it "right", I feel we have to take a couple of steps back and re-do the tables - sorry. But there will be problems later otherwise.
"Light reading" that are well worth your time...
Fundamentals of Relational Database Design by Paul Litwin
or
"Ten Commandments" by Dev Ashish
et al
I am also going to take a few short cuts to save time in development and explanation - break rule #2, on lookups. This can be fixed later, but for now...
Note:
PK - primary key
FK - foreign key
So far, I have identified 9 tables
Membership component
MemberTbl
MemberID - PK
MemberLN - last name, text
MemberFN - first name, text
+ other membership info (membership expiration date, original start date, contact info - phone, address, etc)
table is key to who owns the membership
FamilyMemberTbl
FamilyMemberID - PK
MemberID - FK to Membership table
FamilyLN - last name, text
FamilyFN - first name, text
+ other info (birthday, etc)
table is for a membership family members, assumes 1:M
Point of Sale component
SalesRep
SalesRepCode - PK (can be initials - low security, alphanumeric - better security
SalesRepLN - last name, text
SalesRepFN - first name, text
- You should track who made the sale
ItemTbl
ItemID - PK (or ItemCode)
ItemName - text
ItemDefPrice - currency
ItemSalePrice - currency
ItemEndOfSaleDate - date
ItemOnHand
ItemOnOrder
TaxExmpt - yes / no flag
OrderTbl
OrderID - PK
MemberID - FK
SalesRepCode - FK
OrderDate - date
PayType
PayAmount
Taxes
SalesTotal
Reference - text, credit card#, cheque#
CommitOrder - yes / no flag to lock sale
Comment - memo field to allow notes or comment on sale
OrderDetailTbl
OrderDetailID - PK
OrderID - FK
ItemID - FK
ItemQty
ItemPrice
ItemTotal
Comment - memo field to track any issues
Simple Invoicing System
InvoiceTbl
InvoiceNumber - PK
MemberID - FK
InvoiceDate
Reconciled - yes / no
InvoiceDetailTbl
InvoiceDetailID - PK
InvoiceNumber - FK
InvoiceItem - text - charge, membership, interest
InvoiceAmount - currency
TransactionTbl
TransactionID - PK
MemberID - PK
TransType - text - charge, membership, interest
TransDate
TransAmount
- I am still working this one through. Since you are dealing with cash, you should be able to do a simple journal entry system
Okay, now for the rule breaking, the lookup tricks
Order Table revisited...
When you create the Order table and get to the MemberID field the the table design view, select the LookUp tab at teh bottom of the window. Change the type from "text" to combo box. For the row source, select the Member table, and then invoke the query builder by clicking on the "..." icon to the left of the row source. Drag the last name, then first name and lastly the MemberID field to the query fields. Set the last name and first name to search in ascending order. Exit out of the query builder, and accept the change. Now conitnuing on with the LookUp setup - set Bound Column to 3, and Column Count to 3.
Why take this extra step? When you create the subsquent forms, Access will automatically create a combo box using the query you just created - saves time, and exaplantions later. BUT, per the "Ten Commandments" by Dev Ashish, there are draw backs to this approach. In your case, I feel the drawbacks are minimal, and we can delete the LookUp section later. I just want to get you going.
Note: The Combo Box will display the first field on the form, and it will use the "bound" field for integerity / relational links.
Setup a LookUp for the SalesRep in the same manner.
Order date - set your preferred date type (medium / short), and then for the Default Value, use "Date()" to grab the current system date.
PayType - setup another LookUp combo box, but with a twist.
For the Row Source Type, select "Value List". Then for the "Row Source", cut and paste the following...
"Cash";"Cheque";"CreditCard";"Charge";"Coupon";"No Charge";"Misc"
Syntax for a value list is
"Item1" in quotes + ; (semi-colon) + next item in quotes...
You can change this per your needs. Basically, instead of looking up the information in a supporting table, you created a list that will be used in a combo box automatically created when you create the form. Later you can create a proper supporting table, and revisit this.
For the OrderDetail table
Setup a LookUp for the ItemID, but it will have to be a tad more complex... For the query builder
Field 1 - ItemName
2 - ItemType
3 - ItemID
4 - ItemDefaultPrice
5 - ItemEndOfSaleDate
6 - ItemSalePrice
7 - TaxExmpt
Bound field = 3, number of columns = 7
Invoice table,
Setup a LookUp for the MemberID field as previously done for the Order table.
Create you Item form and any other forms such as your membership / family forms. I will get back to you with the Order table and OrderDetail subform. This will have a bit of code - most of it pretty simple.
Richard