Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2003
    Posts
    42

    Unanswered: Requery Subform Problem

    Hi. I have a sub form attached to a main form. The record source of the subform is a table. The subform is formatted to datasheet view. Ok. Here's what I am trying to do. The users chooses a value on the main form from a combo box. After the event occurs I want to add records from one table to the table in which is the record source for my subform. I can do that just fine but when I requery the subform record the data does not show up in the subform. My sub is below.

    Any thoughts on what the heck is going on?

    Private Sub Update_sfrmEstimateDetails()

    On Error GoTo Err_Update_sfrmEst_Details

    Dim intNumRecds As Integer

    intNumRecds = 0

    intNumRecds = Add_ClaimDetailstoTempTbl <-- function to add records from one table to sub form record source table.

    If intNumRecds > 0 Then ' Verify records are present

    Form_sfrmEstimateDetails.Requery

    End If

    Exit_Update_sfrmEst_Details:

    Exit Sub

    Err_Update_sfrmEst_Details:
    MsgBox "There was a problem appending the data to the temp table. Contact your administrator.", vbCritical, "CCS Estimator - Loss Location"
    MsgBox Err.Description
    GoTo Exit_Update_sfrmEst_Details
    End Sub

    Thanks in advance!

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    How are you adding these records to the table? Look at that ... Is it via ADO or DAO?

  3. #3
    Join Date
    Aug 2003
    Posts
    42
    I'm using DAO. Does that affect it?

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Well taking a look at your code again .. There is a failure point where you trap If intNumRecds > 0 Then ... Can this fail? If it does then no Requery ... Check your logic again ...

  5. #5
    Join Date
    Aug 2003
    Posts
    42
    yeah...that part works. it hits the requery line but nothing shows up on the requery??????????

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by waderw24
    yeah...that part works. it hits the requery line but nothing shows up on the requery??????????
    Then check your function. Are you sure it's adding records? Can you open the table outside of the subform and verify?

Posting Permissions

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