Results 1 to 4 of 4

Thread: Record (2003)

  1. #1
    New Lounger
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Record (2003)

    I am new to Access (so I hope you will excuse some beginner's questions), but I have written many database programs using DOS Basic and Btrieve. I am having trouble with the most basic database form function - looking up a record. In Betrieve, you specify the keyword, the key index, the table, and then tell Btrieve to retrieve the record. Ba Da Bing!

    In Access, I have found a Combo Box switch that allows the user to look up a record by the primary key index. Is there a way to look up a record using other indexes or quiries?

    (I've got Jennings' and Feddema's books if it is easier to direct me to the page)

    Thanks!
    -d

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

    Re: Record (2003)

    Welcome to Woody's Lounge!

    Interactively, there are several ways to look up a record in a table, query or form:
    - You can use Edit | Find to search for a value in the currently selected field or in all fields; you can specify whether you want the search value should match the entire field, the beginning of the field or part of the field. You can search on any field, not just on indexed fields.
    - You can filter in several ways using Records | Filter:
    * Filter by Example - select some text in a field that will act as pattern.
    * Filter by Form - specify criteria for one or more fields in a form.
    * Advanced Filter - specify complex criteria in the same window used to design queries.
    - As you have found, you can use a combo box to look for a record. You're not restricted to looking up by primary key, although that is the default.

    Feel free to post back if you have more questions.

  3. #3
    New Lounger
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Record (2003)

    Many thanks for the quick reply, Hans. I am creating an address book. I have created an index in the table/design view for PostalCode + Customer. The book says that Find will use an index if an index exists, but in my form, Find igores the index.

    I have used the Record Source parameter in the Form Header details box. It seems that changing the source also changes the order of the fields in the form. This prevents changing this paramter on the fly? Am I missing something?

    What I want is a combo box based on a quirey so that selecting a record in the combo box loads that same record in the form. There must be a way, but I'm damned if I can find it.


    Thanks,
    doran


    thanks,
    Doran

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

    Re: Record (2003)

    "Find will use an index if an index exists" means that in very large tables, searching on an indexed field will be faster than searching on a non-indexed field. It does not mean that if an index exists, Find will always use that index.

    Changing the record source of a form can be done, as long as the new record source has the same fields as the old one (not necessarily in the same order).

    The easiest way to create a search combo box is to use the Combo Box Wizard.
    Make sure that the Control Wizards button on the toolbox (the one with the magic wand) is on (depressed), then place a combo box on your form.
    This will start the Combo Box Wizard. Choose the third option, then click Next and follow the instruction.
    When you click Finish, the wizard will create the necessary VBA code for you.

Posting Permissions

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