Run-time error '2467': (1 Viewer)

amirbilal

New member
Local time
Yesterday, 18:46
Joined
Dec 14, 2005
Messages
9
I have an application which I did in 2003 version and then converted it for 2002 version.

Everything works fine in 2003 but when I open in Access XP 2002 version then I get the following error.

Run-time error '2467':
The expression you entered refers to an object that is closed or doesn't exist.

I debuged the application and found the following cause.

I have two forms 'ManageCustomers' and 'AvailableIDs'. AvailableIDs is as subform of ManageCustomers and set to unbound.

Now in VBA of ManageCustomers I am doing the following:
Form_AvailableIDs.RecordSource = someSource

This statement is producing the above described error. It works fine in Access 2003 but in 2002 this error occures.

Thanks in advance for your time.
 

Oldsoftboss

AWF VIP
Local time
Today, 12:46
Joined
Oct 28, 2001
Messages
2,504
I think you will need to refer to the main form first, then the sub form

Forms!MainFormName.Form!SubformName.recordsource or

Forms!MainFormName.Form!SubformName.Form.recordsource

cant remember which it is, but feel this will solve your problem.

Dave
 

amirbilal

New member
Local time
Yesterday, 18:46
Joined
Dec 14, 2005
Messages
9
Okie I tried that but It did not work both the ways.

this is what I get finally.


Forms!ManageExtranet.Form!AvailableIDs.Form.RecordSource = theQuery
Produces the same error


Forms!ManageExtranet.Form!AvailableIDs.RecordSource = theQuery
produces the following error
Run-time error '438':
Objec doesn't support this property or method

Here is some interesting fact I would like you people to note.

If I have opened the AvailableIDs form in design view then this error does not pop up, In case the form is not opened (normal behavior) then the error pops up.

So I think its about that, the RecordSource property of a subform is not accessible when the form is closed.


So is there any way out for this ?????? :S
 

RuralGuy

AWF VIP
Local time
Yesterday, 19:46
Joined
Jul 2, 2005
Messages
13,826
Try: Forms!MainFormName!SubformControlName.Form.RecordSource

The data tab of the SubFormControl shows the LinkChild/MasterFields.
 

RuralGuy

AWF VIP
Local time
Yesterday, 19:46
Joined
Jul 2, 2005
Messages
13,826
This should work if AvailableIDs is the name of your SubFormControl:
Forms!ManageExtranet!AvailableIDs.Form.RecordSource = theQuery
Forms are displayed on other forms by means of a SubFormControl. This SubFormControl has a name of its own. If you used the wizard to create the SubFormControl then it names the control the same as the SubForm it displays but it does not have to be the same name. The SubFormControl name is on the "Other" tab of the SubFormControl property sheet. Here's a reference link for your bookmark collection:
Refer to Form and Subform properties and controls
 

Users who are viewing this thread

Top Bottom