Results 1 to 7 of 7
  1. #1
    rlbroerman
    Guest

    Edit specific record in form (access 2007)

    Your previous reply solved the problem. I just wasn't looking at it correctly.
    New problem-- The report now works the way I want but I want to edit the report. I want to bring up a specific visit and edit it and save the results. If I run "frmRunVisitReport" and put in a SSN and Date it brings up the correct report. I tried to copy this method to use a specific SSN and date to bring up info, edit it and save it with "frmRunVisitReportEdit" but I get some screwy things. I've tried all different fixes but nothing seems to work. I'll bet it is something simply, again. Can you help please. I think I have included everything but only what is needed this time.
    Rick B
    Attached Files Attached Files

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

    Re: Edit specific record in form (access 2007)

    The above post was originally a reply to <post:=732,975>post 732,975</post:>, but that thread had become very long, so I move the post to a new thread and locked the old thread.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Edit specific record in form (access 2007)

    There is not much wrong, I think.

    When you use frmRunVisitReport, the second combo, Visit Date, uses the first combo as a parameter.

    On your new form, frmRunvisitReportEdit, the second combo has to use the first combo from this form, rather than the one one from frmRunVisitReport. So you need to change the query behind this combo to refer to the current form.

    Now I can't test this because you did not included frmPatients in the database. Whether this will work depends on what the data source of frmPatient is.
    Because we are using a visit as the where clause, the form needs to be about Visits. Because you are opening frmPatients, I don't know whether it will work.

    PS You can't edit reports. You know this, so the button is actually opening a form. But you are still using Report to describe what you are doing in the name of the form, and the command button.
    Attached Files Attached Files
    Regards
    John



  4. #4
    rlbroerman
    Guest

    Re: Edit specific record in form (access 2007)

    I tried what you suggested but it still doesn't seem to work. I added "frmPatients" to your attachment.
    Can you look at it again, please.
    Rick B
    Attached Files Attached Files

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Edit specific record in form (access 2007)

    As I feared, frmPatients is not a form about visits. Instead it is a form bound to the table tblPatients.

    You can't open a form with a where clause based on visits unless visits data is displayed on the form.

    Your form does have a visits subform, but that does not work for these purposes . I can't tell exactly what this subform displays because this time you did not include its recordsource qryvisits in the database you posted.

    Is it the case that you want to open a form that allows you to edit details of a particular visit?

    In that case you need to make a new form, similar to the report rptVisitDetails, that shows you just the details of a specific visit, then open that form from your form
    Regards
    John



  6. #6
    rlbroerman
    Guest

    Re: Edit specific record in form (access 2007)

    I tried what you suggested. I made "frmEditVisits" and tried to run it from "frmRunVisitsReportEdit", but it doesn't work. I get an error "value is not valid". Everything seems to match as far as I can see.
    Can you help, please?
    Rick B
    Attached Files Attached Files

  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Edit specific record in form (access 2007)

    The attached version works.


    1. <LI>The form frmRunVisitReport was unbound (ie it does not have a data source), so when we copied this form the copy was also unbound.
      In the latest set of changes you connected this form to qryVisits, so when you choose values with the combo boxes you are actually changing stored data.
      So I have removed the Record Source from the form, and the Control Source from its Controls.
      <LI>QryVisits (used by frmEditVisits) joins Visits to Pain Level. So any Visits with no Pain data don't appear. I have changed the Join Type to show Visits with no pain data.
      <LI>The purpose of frmRunVisitReportEdit is to open a Form, not run a Report so I have renamed the form, and changed the caption on the command button
    Attached Files Attached Files
    Regards
    John



Posting Permissions

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