Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Refresh Data (A2003)

    Ok..here goes.

    I have 2 bound forms, frmRequest and frm Review. frmRequest is a tabbed form (6 tabs) and each tab has 1 control (mostly cbo boxes).

    User has the opportunity to review his/her request by using frmReview. Each cmd button on frmReview corresponds to each pg on frmRequest. If the user needs to modify specific data, depending on the cmd button clicked, the user is taken to frmRequest using the following code:

    <hr> If IsLoaded("frmRequest") Then Forms![frm_Request].Visible = True<hr>

    along with some other code that takes the user directly to the page on frmRequest. All works well. However, once the change has been made, frmReview doesn't reflect the change until the form is closed and reopened.

    I've tried:

    frmReview.requery

    frmReview.requery
    frmReview.refresh

    in the AfterUpdate event of the control being changed, in the OnLoad of frmReview, in the OnClose event of frmRequest but nothing seems to work.

    The OnClick event of a command button on each tab, "cmdEditComplete", I have code that closes frmRequest as well as the following:

    <hr> If IsLoaded("frmReview") Then Forms![frmReview].Visible = True<hr>

    Can someone please provide some insight to this?

    Thanks in advance.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

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

    Re: Refresh Data (A2003)

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Refresh Data (A2003)

    Thanks Hans,

    I'm attaching the db in 97 format as I couldn't get below 100kb.
    Attached Files Attached Files
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

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

    Re: Refresh Data (A2003)

    There are several problems.

    1) You open frm_Request_A_DAR without specifying which record to load, so the record in frm_Request_A_DAR is not necessarily the same as the current record in frm_Review_A_DAR.
    You can solve this by specifying a where-condition in ReviewTheData:

    Public Sub ReviewTheData()
    DoCmd.OpenForm "frm_Request_A_DAR", , , "pkDARRequestID=" & Me.pkDARRequestID
    End Sub

    (You must include pkDARRequestID on the form, hidden if you prefer)

    2) In the code behind the command button on frm_Request_A_DAR, you have

    DoCmd.Save

    This line does NOT save the record, it saves the design of the form frm_Request_A_DAR. You should use

    RunCommand acCmdSaveRecord

    instead. You shouldn't even need to refresh or requery the other form.

    I have attached the modified database (in Access 2000 format).
    Attached Files Attached Files

  5. #5
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Refresh Data (A2003)

    As always Hans, works perfect.

    Thanks again for your assistance.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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