Subform reference problem (1 Viewer)

ASherbuck

Registered User.
Local time
Today, 08:12
Joined
Feb 25, 2008
Messages
194
FrmItem uses a table for a recordsource and has text/combo fields to show the data.

FrmItem has a subform, frmSearch. frmSearch let's you search by name for an item and lists the results in its detail section (continuous form). Clicking an item on frmSearch navigates to that record on FrmItem.

Everything is great up to here.

I take FrmItem and I put it on another form, FrmDashboard. When I click an item on frmSearch it says "The object 'FrmItem' is not open"

Here is my code from frmSearch. This is the onclick for each item:

Code:
DoCmd.GoToRecord acDataForm, Me.Parent.Name, acGoTo, ID
Me.Parent!cmdSearchItems.SetFocus
Me.Parent.FrmSearch.Visible = False

This makes no sense to me. FrmDashboard is the parent of FrmItem and FrmItem is the parent of FrmSearch. It is impossible for FrmSearch to be open without FrmItem being open.

I'm hoping this is a weird human error. I was hoping on doing three parts this way, Vendors and Contracts, and putting all three on a dashboard form.

Any help?
 

spikepl

Eledittingent Beliped
Local time
Today, 17:12
Joined
Nov 3, 2010
Messages
6,142
A form embedded in another form is NOT open such that you can refer to it as a stand-alone form. Whenever in doubt about references, make a textbox, open its property sheet, click the ellipses in the Control Source property, and use the Expression builder to navigate to the control in question, click Paste and you have your reference.
 

ASherbuck

Registered User.
Local time
Today, 08:12
Joined
Feb 25, 2008
Messages
194
That's a pretty sweet trick.

I'll give it a shot on Monday. If it works for me this could save hours of headaches.

Thanks
 

Users who are viewing this thread

Top Bottom