Results 1 to 8 of 8
  1. #1
    WayneSteenkamp is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    107

    Creating a database

    My database skills are average but know enough to get by with the basics.

    My question to you guys is:
    I need to create a database that records Simcards, Phones, Repair history to the phone if any,
    The complicated part for me is theres a few options to record the data.
    1) A table that records the Simcard assigned to the phone,
    2)if the simcard is "Cancelled" i.e damaged and needs replacing, "Assigned" to a Phone or on its own "Unassigned"
    If the Simcard is damaged "cancelled, It is tracked/recorded when and why.So a SimCard History Tracker table? The phone will then be assigned with a new simcard.

    How many tables do i need?
    I'm thinking:


    2 tables for the phone - 1 which has the details and the other tracking the history. (Could have a form with a subform with it?)
    2 tables for the Simcard? 1 for the SimcardSerial numbers and the other showing if its Cancelled/Assigned/Unassigned

    Am I on the right track?

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You will need a table for the basic phone information. Also, since a phone can have many SIM cards over the course of its life, you have a one-to-many relationship. Additionally, a SIM card can be placed in multiple phones over time which is another one-to-many relationship. When you have 2 one-to-many relationships between the same two entities (phones & cards) you have a many-to-many relationship which is handled with a junction table.

    tblPhones
    -pkPhoneID primary key, autonumber
    -fkManufacturerID foreign key to a table that holds all manufacturers
    -other fields related to the phone


    tblSIMCards
    -pkSIMCardID primary key, autonumber
    -txtSIMCardID
    other fields related to the card

    The Junction table

    tblPhoneSIMCards
    -pkPhoneSIMID primary key, autonumber
    -fkPhoneID foreign key to tblPhones
    -fkSIMCardID foreign key to tblSIMCards
    -dteEndEffective (when the card was uninstalled in the phone)


    You can use the above table to determine which cards are assigned versus which ones are not. I do not know if that is sufficient to address the status of a card.

    Regarding the status, you could have a table to hold events related to the card such as when it was purchased and when it was trashed, but you would not need to track assignments since that is handled in the table above.

  3. #3
    WayneSteenkamp is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    107
    Cool, Thanks.

    Next part i'm stuck on now is the 'Assigning' part.
    In my SimCard Table I have all the Sim cards entered as 'Unassigned' as Default. Which is what I want. It's in a dropdown menu with the other two texts "Assigned" and "Cancelled".
    What I need to be able to do now is when I'm on the PhoneID table, and attach a simcard to it, it needs to have the status change from "Unassigned" to "assigned" in the SimCard table.

    Any ideas on this?

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    First, although Access has the capability of having lookup fields at the table level, it is generally not recommended. Having lookups at the table level can cause several issues as detailed on this website. As a matter of fact, you do not even need the field you are discussing. If you add a SIM card to a phone, you would add a record in table tblPhoneSIMCards. As long as the dteEndEffective field in that record is null, you know the SIM card is assigned. If a SIM card has either no corresponding record in tblPhoneSIMCards or if the record has an end effective date, you know the SIM card is unassigned. You would not have to update a field to designate the status, you would only need to run a query to find the current status.

  5. #5
    WayneSteenkamp is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    107
    I understand what your trying to say. Stating the obvious the client still wants a status displayed on the table/forms showing it. Any ideas?

  6. #6
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You can still assign a status based on the query results, that is not an issue. You would just use an expression in the query.

  7. #7
    WayneSteenkamp is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    107
    Oh right, Fair enough.
    Can you help start me off?

    Thanks

  8. #8
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I have provided a framework for the table structure in my previous posts to get you started. The next step is to create that structure in a database along with other fields/info applicable to your application and populate it with some test data.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Creating new database.
    By rjurke in forum Database Design
    Replies: 5
    Last Post: 09-28-2011, 04:55 PM
  2. Creating new database
    By rjurke in forum Access
    Replies: 10
    Last Post: 09-23-2011, 04:59 AM
  3. Creating First Database
    By marrone12 in forum Database Design
    Replies: 1
    Last Post: 09-08-2011, 05:02 PM
  4. Help with creating a database
    By ITChevyUSSNY in forum Access
    Replies: 0
    Last Post: 07-31-2009, 05:48 AM
  5. Creating database
    By ramzyamal in forum Database Design
    Replies: 1
    Last Post: 05-07-2007, 08:53 AM

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