Link to home
Start Free TrialLog in
Avatar of giswest
giswest

asked on

MS Access--Psuedo Split Form Error

I've implemented the code samples provided by Jeff Coachman (https://www.experts-exchange.com/questions/24828935/Split-form-as-a-subform.html?sfQueryTermInfo=1+10+30+access+form+split+subform)  and Helen Feddema (https://www.experts-exchange.com/questions/26311529/How-to-open-split-form-as-a-subform-in-access2007.html?sfQueryTermInfo=1+10+30+access+form+split+subform), which provide the code for establishing "split form" functionality between a main form and subform.  Everything works well, until certain types of filters are applied (Filter By Date, Filter By State/County, and Filter By Grantor of Grantee--See attached databases).  When one the specified filters is applied, and I then select a record in the subform, I either recieve a Run-time error '2473' error (Pseudo_Split_Form_boaq2000) or Error No: -2147417848; Description: Method 'FindFirst' of object 'Recordset2' failed Error.

Based on the debug results, it appears that the error related Helen's code is linked to the Me.Parent.Bookmark = Me.Parent.RecordsetClone.Bookmark portion of the code.  However, I'm not sure which portion of Jeff's code is producing the Run-time error.

Any help on these issues is appreciated.
Psuedo-Split-Forms.zip
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

When posting a sample Database, please use the following guidelines:

1. Back up your database(s).
2. Combine the front and back ends into one database file.
3. Remove any startup options, unless they are relevant to the issue.
4. Remove any records unless they are relevant to the issue.
5. Delete any objects that do not relate directly to the issue.
6. Remove any references to any "linked" files (files outside of the database, Images, OLE Files, ...etc)
7. Remove any references to any third party Active-x Controls (unless they are relevant to the issue)
8. Remove, obfuscate, encrypt, or otherwise disguise, any sensitive data.
9. Compile the code. (From the database window, click: Debug-->Compile)
10. Run the compact/Repair utility.
11. Remove any Passwords and/or security.
12. Post explicit steps to replicate the issue.
13. Test the database before posting.

In other words, ...post a database that we can easily open and immediately see/troubleshoot the issue, and if applicable, also include a Graphical representation of the Exact results you are expecting.


JeffCoachman

Avatar of giswest
giswest

ASKER

Sorry about that Jeff.

Attached are screen shots of the errors generated, and updated database examples (unlocked and ready to go).

I'll break this response into two parts to hopefully eliminate any confusion.

1. Coachman's Code (Refer to boaq2000_Error screenshot and Pseudo_Split_Form_boaq2000 DBASE):

a.  Open Pseudo_Split_Form_boaq2000, and then open the "Sales Viewer" form.  You'll see that the main form contains a subform, which acts as a "splitform", and displays all records contained in the Comp_Sales_Load table.  If you click a record in the subform , you'll see that it does function like a splitform.

b.  In the Filter By State/County filter tool located at the left of the main form, select "NE" from the State dropdown, and then select "Buffalo" for the County dropdown.  This will filter for all records pertaining to Buffalo County, NE.  You'll see that the form filters properly.

c.  Click on a record in the subform (a record other than the currently displayed record), and the Run-Time error '2057' is generated (Originally it was a Run-Time error '2473').  The same error is generated when using the Filter By Date and Filter By Grantor or Grantee filter tools.  However, I don't encounter the error when using the Filter By Sale filter tool.

2. Feddema's Code (Refer to feddema_Error screenshot and Pseudo_Split_Form_Feddema DBASE):

a.  Repeat steps 1a. and 1b. for the Pseudo_Split_Form_Feddema DBASE.

b.  After applying the Filter By State/County filter tool, click on a record in the subform (a record other than the currently displayed record), and the Error No: -2147417848; Description: Method 'FindFirst' of object 'Recordset2' failed Error is generated.  The same error is generated when using the Filter By Date and Filter By Grantor or Grantee filter tools.  But again, I don't encounter the error when using the Filter By Sale filter tool.  The one thing I did notice before recieving the error, was that it appeared as though the form gets caught in some type of loop, because you'll see the database loop through the records in the record information fields located at the top of the main form.

Hopefully I've laid out everything in a less confusing manner.  Let me know if you have any additional questions.

Thank you.
feddema-screenshot.jpg
boaq2000-screenshot.jpg
Pseudo-Split-Forms-v2.zip
I'll look at this tonight
Avatar of giswest

ASKER

Sounds good.  Thank you for the help.
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of giswest

ASKER

Jeff,

That's kind of the conclusion I've come to.  I initially set up the form as a normal split form, and had no issues with filter functionality.  I started looking into using a subform as a splitform because it gave the form layout a cleaner look.  I'll probably wait to see if anyone else chimes in on the subject, but In the end it does come down to functionality, so I'll probably revert back to the original split form.

Thank for the feedback (again).  I should just put you on speed dial, because I think that you've helped me with almost every issue I've posted :)

Have a good weekend.
It's funny, I rarely look at names or points.

I just try to help out where I can.

;-)

Jeff