Results 1 to 7 of 7

Thread: Find Record

  1. #1
    Join Date
    May 2005
    Posts
    30

    Unanswered: Find Record

    HELP!!

    I am trying to write code behind a button on my form that will populate data from a specific record in the form for update. The form contains Employee Data andis driven by the employee ID. SO i want to be able to hit a button and pull up the form with the employees information already populated so taht I can update the information.. help please

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    sounds like a combo box that "finds a record on the form based on the control" will work - it's one of the options when using the control wizard

  3. #3
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    Are you opeing a second form? Or is this form opened by a form that knows the Employee ID you want? If so then you can use the OpenForm method to open the form and filter for the specific employee ID.

    DoCmd.OpenForm "YourFormNameHere",acNormal,,"EmployeeID=" & txtEmployee,acFormEdit,acDialog

    This line will open your form to the EmployeeID that is in the txtEmployee text box. You will need to change the name of the Employee text box. But if you put this in your button's OnClick event it will open the form where you need it to.

  4. #4
    Join Date
    May 2005
    Posts
    30
    This is close to what i needed, but what i really wanted to see was a button on my form where i could click update and a script box would pop up asking me which record i would like to find. I put in the employee id and click enter and then the information is loaded into the form. its one form so nothing additional to open. I used to have a peice of code that did this, but i just cant find it!!!

  5. #5
    Join Date
    Apr 2006
    Posts
    7
    You could also create an additional form indicating the fields that you would like to update.

    From there, on your form where you input the information - put a command to add/delete/change/update, etc. and up will pop your second form.

    Have bound fields on the update form to the table where the employee information is kept.

  6. #6
    Join Date
    May 2005
    Posts
    30
    Actually i was thinking that it would be more asthetic on one form. input the id in a text feild and then click the cmd button and have it retrieve the information into the form for updating.. just dont know the code

  7. #7
    Join Date
    Apr 2006
    Location
    Huddersfield, UK
    Posts
    154
    well, i don't know if it is any use to you, but, thinking out loud....

    create the 2 forms (id search) & (employees)

    On (id search) have the additional form (employees) built in as a sub-form, so you have a two tiered form...

    ---------------------------
    | search id : 111 |
    ---------------------------
    | |
    | details load in this sub form|
    | |
    ---------------------------

    then the sub form applies the details that are in search id as a filter/you use it as a query.

    I cretaed something simialar, i may be able to set up a template for you to knock around with,

    just food for thought.

    Dan

Posting Permissions

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