Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    UK
    Posts
    233

    Unanswered: How do I use Update Query

    I want to update a record in an existing table.

    I have two tables
    tblHeader and tbllines

    When the status of the lines is updated I want to also update the status in the header table.

    I have set up an update query but am obviously missing the point here.


    This identifies the data that I want to use to update the field in the header table. I then enter the name of the table and the field in the update box in the query.

    When I run the query it comes up with the msg "Enter Parameter Value". I have also attached a screen print of the query.

    Can someone explain how i do this?

    Many thanks.
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    how are you doing your data entry, by form or by table

    if by form, are you using a subform, if using a sub form then yoiu can set a value on the parent form which forces an update


    lets assume your status column is called headerStatus

    then
    from the subform
    in the subforms afterupdate event
    forms!<myparentform>!<myheaderstatuscontrol>!<myne wstatusvalue>

    you may need to tweek this to match your requirements, but the general skeleton should work

  3. #3
    Join Date
    May 2003
    Location
    UK
    Posts
    233
    I am sure this will work, but I am having a bit of difficulty tweeking!

    Sorry -

    I am using a form and a sub form

    So yes if I can update the record in the main form that would be great.

    The main form is called "frmcust_query_header"

    The subform is called "frmcust_query_lines"

    in the sub form I use a combo box called "cmbStatus"

    in the main form there is a text box called "txtStatus"

    What code would I sued to update the txtStatus AfterUpdate of the combo box?

    Appreciate your help, thanks.

  4. #4
    Join Date
    Oct 2005
    Posts
    178
    I think you are missing the criteria if you are running the update query. That parameter value is missing.

Posting Permissions

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