Connecting Tech Pros Worldwide Forums | Help | Site Map

Unable to change recordsource on sub-form

Expert
 
Join Date: Apr 2007
Posts: 192
#1: Jan 17 '08
Hi,
I have a data-entry form, with a linked sub-form.

This has been copied to a admin-edit form, and different linked sub-form

The only difference between the 2 sets of forms is that the data-entry has the data-entry property set to true, and the admin forms allow deletes and edits.

I have this line in the on-open event of both main forms.
Expand|Select|Wrap|Line Numbers
  1.     Me.fsubPOFAdminEdit.Form.RecordSource = "tblPregOutcomeFormChildrenDoubleEntry"
  2.  
It basicaly changes the source table from normal to double-entry.

On the data-entry form, no problem at all

On the admin-edit form I get the error message

Run-time error 2455
'You entered an expression that has an invalid reference to the property Form/Report'

Please someone tell me I have made an obvious mistake, cause I have hours trying to find out whats wrong, including decomplie,export/import, creating the form again from scratch, still get the same error.

Oh, using Access 2003

TIA

FishVal's Avatar
Expert
 
Join Date: Jun 2007
Location: Israel
Posts: 2,584
#2: Jan 17 '08

re: Unable to change recordsource on sub-form


Hi, Lysander.

Could it be so that your main form is in Datasheet view?
Expert
 
Join Date: Apr 2007
Posts: 192
#3: Jan 18 '08

re: Unable to change recordsource on sub-form


Quote:

Originally Posted by FishVal

Hi, Lysander.

Could it be so that your main form is in Datasheet view?

Thanks but No, Datasheet view is set to no.
Expert
 
Join Date: Apr 2007
Posts: 192
#4: Jan 18 '08

re: Unable to change recordsource on sub-form


Solved it, really weird.

The data entry form allows additions, but no edits

The admin edit form does not allow additions.

If I let the admin edit form allow additions, then it lets me change the recordsource on the sub-form. If not allowed, I get this weird error.

Problem solved, but I can't see how allowing or not allowing additions to one form causes you to be unable to change the recordsource of a sub-form
Reply


Similar Microsoft Access / VBA bytes