Form based on query used to open another form.

  • Thread starter Ivan R via AccessMonster.com
  • Start date
I

Ivan R via AccessMonster.com

Okay, I have a mainform based on multiple tables. It has tabs etc...it is
also filtered by users so that other users cannot access each others
information. The mainform has a next record and previous record button,
which is determined by the filtered recordset. I also have a query which
determines which records are active. There is a form based on this query
that will allow the user to select the record and open the mainform with the
selected record the problem occurs when the user attempts to go to the next
record, the command used to open the mainform from the form based on the
query is

docmd.openform "mainform",,,"CaseID="&forms!activequery!caseid

I would like to be able to open the form and then do a find of the caseid
based on the selected record in the query. In my latest attempt, I only open
the form, so that the mainform is not filtered to only one record. In the
mainform I have put code which will determine whether the activequery is open
if it is then i would like it to search for the case and make it the active
record.

I have attempted to put the find code in the On Activate, On Load, On Open,
On Mouse Move, On filter, even On Current, with no success. I continue to
get Error code 2137. Any suggestions will be appreciated.

my find code is

if isloaded("activequery") then
docmd.findrecord "Caseid="&forms!activequery!caseid
endif
 
Top