Results 1 to 2 of 2
  1. #1
    Join Date
    May 2008

    Unanswered: Error on subform refresh

    I'm working on an Access project (an .adp file) which is connected to SQL Server 2005. I have a form and a subform, and the subform gets records from a stored procedure called PETech. PETech takes in a parameter @act (a code) and returns all records where a certain column matches that parameter. I have a combo box in my main form with a list of all possible codes. The user should be able to pick a code and the subform will refresh to list only the records matching that code.

    The main form is called Form1, the subform is called PE_subform, and the combo box is cbeActCde.
    I put the following in the Input Parameters property of my subform: @act nvarchar(8) = [Forms]![Form1]![cbeActCde]. In the code for the AfterUpdate event of the combo box, I put: Forms(PE_subform).Refresh.

    When I open the form and pick a code, the list refreshes and shows the right records, but the form crashes immediately on the Refresh statement in the VB code and I get this error: "Run-time error '7874': PE Database can't find the object 'PETech'."

    Does anyone know what's wrong? Again, I'm getting the right results so the input parameters are working, but the program crashes as soon as the results are returned. Should I be using another function instead of Refresh? I tried Requery but that didn't work.


  2. #2
    Join Date
    Jan 2007
    Provided Answers: 12
    Is the form bound? If not you have to re-execute the query instead of refreshing.
    Home | Blog

Posting Permissions

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