Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2013

    Unanswered: Help with SearchForRecord

    I have a form that I would like to use to update training information for my company's employees. There are two cases:
    1) The employee already has a record for the training but the date needs to be changed.
    2) The employee needs a record added for that training.

    In the form I have combo boxes for selecting the employee and the specific training from existing tables. If a training record exists for that employee/training combination, I would like the date_completed to auto-populate. Otherwise, I would like a record to be created in the appropriate table.

    I think I can use SearchForRecord to locate the correct record in the training completed table and pull the date from there, but I'm not sure how to phrase the code.

    All suggestions appreciated!

  2. #2
    Join Date
    Jan 2009
    Kerala, India
    1. Create the Comboboxes for Employee/training (Unbound) on the Header section of a Form (say Main Form).
    2. Design a Form on the Training Completed Table and insert it in the Detail Section of the Main Form.
    3. Use the Combobox references as Link Master Field Property value of the Sub-Form.
    4. Use corresponding field references from Training Completed Table in the Link Child Field Property value of the Sub-form.
    5. Save the Main Form with the Sub-Form.

    When you select values from the Comboboxes on the Main Form it's corresponding record, if available in the Training Completed Table, will automatically populate in the sub-form, otherwise the sub-form will be empty. (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

Posting Permissions

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