Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 38
  1. #16
    kiko is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Posts
    21
    Oh yes yes. Thank you for helping. I know you're trying to provide enough info and examples, I understand. It's just that I was confused about the "line" as I saw people use it a lot in their database, so I was wondering is it a must to include that. But really, thank you so much for the help! Really appreciate it. My mother tongue is Malay as I'm from Malaysia

  2. #17
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Is your problem solved? Or do you have more questions?

    How good is google??

    Adakah masalah anda diselesaikan? Atau adakah anda mempunyai lebih banyak soalan?

  3. #18
    kiko is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Posts
    21
    My problem is solved. I managed to understand a lot more about access with your help! Thank you so much.

    And yes, I have some more questions actually.

    1. How do I delete records, say for books that haven't been sold for a month or more?
    2. I don't manage to find out how to make automatic calculation in my database for quantities bought and sold. I tried referring in books but it's confusing for me :|

    Haha, google is actually quite good in direct translating. Not bad.

  4. #19
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    1. Create a select query to get the records involved.

    I didn't have a Salesdate, so Ill use Orderdate.

    You know which books were ordered in which Order, so find the books that have been Ordered in the last X months.

    The Books that are not in that set have not been Ordered(sold) in that time period. (I think)

    This is an academic exercise, right? You wouldn't normally delete such records. You might want to send some back to the suppliers, or do some marketing to sell them.....

  5. #20
    kiko is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Posts
    21
    I will try that. How about second question?

  6. #21
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    How about posting a copy of your database? I'll look at your material that has all the tables.

    Here's a general overview off the top of my head -there are examples and many posts involving this sort of thing.

    A lot of times people will keep transactions in a separate table. Transactions would have info on the Book,Price,Quantity and Date amongst others. Transactions out(sales) are negative, Books coming in from Suppliers(acquisitions) would be positive. At any time would be
    QuantityonHand = LatestInventoryCount + AcquisitionsQty since LatestInventory - SalesQty since LatestInventory.

  7. #22
    Parsonshere is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2012
    Location
    Rusk
    Posts
    25
    BooksKiko should not be defined in your relationships at all. That is only used as a rowsource for a combobox or something to make a selection. These items will be discontinued also, so you want to be able to remove them from our inventory reference, while you will keep the actual record in orderlineItemKiko. Think of BookKiko as a completely separate inventory database, and the customer order as the sales database. Also, even though what you have works, normally you would make ordlineItemID and OrderRef both Primary Keys. This way, you could actually number the line items with the field ordlineItemID in the invoice. As for deducting, you could add a Boolean, and make sure it is not editable in your form, to mark the record as having been deducted from inventory. Use a command button to programmatically edit the Boolean and run the query to deduct the inventory at the same time. You may want the Boolean in the item table, in case of a partial order fill. I am just thinking, probably a better way to do that.

  8. #23
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Interesting comments.
    However, I mocked up this data base to help Kiko with some basic concepts. I purposely did not make my database match his data model. He will have to adjust and hopefully learn from those adjustments to his real database. It's my view this is a school assignment, and we here do not do school assignments. We offer assistance and some examples, but the student/poster will learn something from examples and will do the work themselves.

    BooksKiko should not be defined in your relationships at all. That is only used as a rowsource for a combobox or something to make a selection.
    When you make a statement like this to someone who is learning, you should review the code and verify your facts. Misstatements can confuse the reader.
    I purposely did not use any forms in this mock up, so there is no combo box.

    BooksKiko is the only place that a Book's genre is identified.
    So to answer his query #4 from his post#6
    4. Output list of book genres in order of popularity.
    you need the table BooksKiko.

    These items will be discontinued also,
    You appear to know more about Kiko's set up than Kiko has mentioned, or are guessing at some things. Or you are in his class and know more details of the assignment???

    If you look closely at Kiko's data model you will see that not all tables are linked. He cleverly positioned his Return_Outwards table with a list of tables. So his model was not complete. He will have to work out the linkages.

    I don't believe his assignment was "inventory control" based --FIFO, LIFO, Reorder points, Partial Order, Partial deliveries, Alternate Suppliers, Item Substitutions.... etc. but may be there was more to the assignment.

    Bottom line is I created a simple database based on a generic Customer -Order-OrderLineItems- Items model. I read what Kiko said were his issues and tried to simulate with simple constructs to help solve those issues. He seems keen to learn, but we have not seen his work.

    I appreciate the comments you have made and I hope you enjoy the feedback. And please recognize, as I do, that there are many ways to set up tables and relationships and solve problems. If there were only one answer, wouldn't we all use that solution.

  9. #24
    kiko is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Posts
    21
    I don't know why am I having problem to upload my database here. I've been trying to do that few times now but it doesn't seem like it's coming out.

    Parsonshere, thank you so much for your help. But I somehow don't really understand that much about access so I don't use combobox function.

    My lecturer only wants us to make a simple database to store information on customers, suppliers, stocks. He doesn't really provide us that much information about what should be in the database or whatever as he just simply let us do however we want it. Which is actually more harder as he doesn't really help us a lot so we would have to find out through internet or forums like this.

  10. #25
    kiko is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Posts
    21
    Orange. How is it possible as for my query to find customer who has spent the most, i want to show the first name and last name as well as the customer ID?

  11. #26
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Did you look at the example query? KikoCustomerWithMostSpending

    In the query designer, add the KikoCust table, join it to the original query on CustId, then add the FName and LName fields to output.
    Code:
    SELECT TOP 1 [%$##@_Alias].CustKiko.CustId, [%$##@_Alias].Spend, CustKiko.CustFName, CustKiko.CustLName
    FROM (SELECT CustKiko.CustId, Sum([AgreedPrice]*[Quantity]) AS Spend FROM (CustKiko INNER JOIN CustInfoKiko ON CustKiko.CustId = CustInfoKiko.Custid) INNER JOIN OrderLineItemKiko ON CustInfoKiko.CustOrderId = OrderLineItemKiko.OrderRef GROUP BY CustKiko.CustId ORDER BY Sum([AgreedPrice]*[Quantity]) DESC)  AS [%$##@_Alias] INNER JOIN CustKiko ON [%$##@_Alias].CustId = CustKiko.CustId;
    This alias [%$##@_Alias] is created by Access with the original query.

    Remember, there are many ways to do sql queries.

    Results from my examples

    CustId Spend CustFName CustLName
    1 $1,271.30 Jim Smith

  12. #27
    kiko is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Posts
    21
    Because I already try adding the FirstName and LastName but an error came up. Will try this one now.

  13. #28
    kiko is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Posts
    21
    I already tried. It works but it gives me different results. Why is that?

  14. #29
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  15. #30
    kiko is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Posts
    21
    WonderWare.zip

    attached is my database

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to order columns in ascending order?
    By darkingthereturn in forum Access
    Replies: 5
    Last Post: 06-18-2012, 05:24 AM
  2. Sort order in a sub form
    By roar58 in forum Forms
    Replies: 1
    Last Post: 03-17-2012, 08:57 PM
  3. Goods Order Form
    By amraam840 in forum Forms
    Replies: 7
    Last Post: 12-08-2011, 04:42 PM
  4. Sequential Order ID on Form
    By charya in forum Forms
    Replies: 1
    Last Post: 01-15-2011, 10:51 AM
  5. Help With Purchase Order Form
    By SpeedyApocalypse in forum Forms
    Replies: 29
    Last Post: 04-09-2010, 07:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums