Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Location
    Corpus Christi, Texas
    Posts
    132

    SQL EntyID to FirstName

    I'm sorry for asking but they don't tech us females about techie stuff but I’m trying my best. I have been working on this one problem for 3 days and I read about half a library.

    I'm trying to build a client database that stores their info and all their notes that they make over time (notes are under Time and Date)


    My database consist of (Table Clients - entryid, FirstName, LastName, and so on.
    And (Table TimeDate – entryid, LastName, FirstName, Time, Date, Notes.

    I have the Client side working great but I can’t get the TimeDate working.
    When I enter the info it fills in the Client and TimeDate at the same time but if I’m working under a existing client and make a new note it will add a new entry to the TimeDate.

    I just need it to populate the box on the left with all the notes that corresponds with that client. The right side populates the clients when opening the program. I can get the entryid of the client


    -- get selected item(s)
    tSelected = ListBox.GetSelected(this);

    -- check that there was something selected
    if tSelected then
    -- set nSelected to first (only) selected item
    nSelected = tSelected[1];

    -- Get the entry id of the current item (Data)
    nEntryID = ListBox.GetItemData(this, nSelected);

    end
    But i don't understand how to take the ID of the client and get all there notes in TimeDate to populate the box on the left.
    I attached a zip of a database and .am6 as it might help. LOL

    Thanks for any help.
    Attached Files

  2. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    One thing I would do is create a relationship between your two tables. That is afterall one of the great things about a database. This can cut down on the number of fields you have. For instance your tables consist of the following:

    Clients table contains all the data about the clients.

    entryid, LastName, FirstName, Email, PhoneHome, AddressHome, PhoneWork, AddressWork, Notes, Time, Date

    The TimeDate table contains the logs you want to record
    entryid, LastName, FirstName, Time, Date, Notes

    It seems like the entries in red are duplicated between the tables. If this were my application I would build my tables like this:

    Clients = entryid, LastName, FirstName, Email, PhoneHome, AddressHome, PhoneWork, AddressWork

    TimeDate = entryid, Centryid, Time, Date, Notes

    The field Centryid would tie to the customers record in the clients table and all the notes that they record would be stored in the TimeDate table.

    When ever the client recorded a note, I would enter the entryid from the client table as the Centryid in the TimeDate table along with the Time, Date and the actual note. If you then want to find all the entries by a particular client in the TimeDate table you could query it like this:

    SELECT * FROM TimeDate WHERE Centryid = 2

    If you wanted to check for any entry that was made today you could query the table like this:

    SELECT * FROM TimeDate WHERE Centryid = 2 and Date = '03/15/2006'

    I hope some of this helps you with creating the actions.

    Can you export your project for us to see(File->Export). The .am6 file does not have any code that would populate the list boxes.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  3. #3
    Join Date
    Mar 2006
    Location
    Corpus Christi, Texas
    Posts
    132
    Thanks again but that didn't work but made me think of another way.

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Good, i am glad you got something working.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

Similar Threads

  1. Microsoft SQL Server 2005 Express Edition
    By linuxbox in forum Setup Factory 7.0
    Replies: 0
    Last Post: 12-25-2005, 07:55 PM
  2. Do I really need SQL for this?
    By CelticDragon in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 08-12-2005, 07:10 AM
  3. SQL Lite
    By Roboblue in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 11-20-2004, 03:30 PM
  4. SQL - Easy does it
    By Intrigued in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 08-22-2004, 09:48 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