Results 1 to 11 of 11
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Autocomplete (2003)

    I have a table, which has a autonumber for a log No, with a description. I have another table which is like a timesheet. I want the user to be able to key in the log no on the timesheet, and the description will be filled automatically. I also want the user to be able to enter a description of work which is not related to a log No. I used a query to do the first bit, but when I entered a description, it automatically created a new log number. What's the correct way of doing this?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Autocomplete (2003)

    What fields does the timesheet-like table have?
    How is it related to the main table?

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Autocomplete (2003)

    The table has a start time, end time, description, and log No. The two tables are linked with the log No.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Autocomplete (2003)

    What is the data type of the log no field in the timesheet table?
    Is there a primary key, and if so, on which field or fields?
    In your original question, did you want to copy the description from the main table to the timesheet table?

  5. #5
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Autocomplete (2003)

    The data type is a number. There is no primary key. And yes I did want to copy the description from the main table.

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Autocomplete (2003)

    No primary key? Then what is the log number? If you're going to use Access's relational features optimally, you'll have to use primary keys.
    Charlotte

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Autocomplete (2003)

    Why would you want to copy the description? You can always retrieve the description from the main table in a query (and use it in a form or report), that avoids duplicate storage.

  8. #8
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Autocomplete (2003)

    I've created a primary key, and the query is retrieving the description (that's what I meant before, not 'Copy'). But if I try to enter data without a log, I get Microsoft Jet Engine can't find 'Log No'

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Autocomplete (2003)

    In the first post in this thread, you stated that you wanted the user to be able to enter a description that is not related to a Log No. Such descriptions don't belong in a table that is linked to the main table on Log No. You should create a separate table for such comments, and the user should enter them separately.

  10. #10
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Autocomplete (2003)

    Thanks Hans, I've done that. I've also created a basic table with just ID, Name, and Date on it. How can I incorporate this into a form, so that on each day, a user can enter his name, and enter the work, as your previous answer. I tried putting an ID on the Timesheet table and linking them, but that doesn't seem to work.

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Autocomplete (2003)

    As far as I can tell, there will be no relationship between the timesheet table and the new table, so I don't see why you would want an ID field in the timesheet table.

    I think you should work out the data structure you need on paper BEFORE trying to create any tables, queries and forms. You can download a short introduction Understanding Relational Database Design from the Microsoft site.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •