473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Populate a subform after detail.visible produces an error

I have an Access 2000 form that I open showing only the header. The
form's detail section visible property is set to false.
The detail section contains a subform. Using a command button, I use
the code:
Me.Detail.Visible = true
Me.SubFormName.Form.RecordSource = "sprocXYZ"

It returns the following error:
"2455 - You have entered an expression that has an invalid reference to
the property Form/Report."

If I set the form's detail section visible property to true in design
mode, the code works fine.

For some reason, Access doesn't recognize the subform if the form opens
with the detail section set to false.
Is there a workaround for this?
Thanks,
lq

Nov 13 '05 #1
3 2014
> For some reason, Access doesn't recognize the subform if the form opens
with the detail section set to false.
Is there a workaround for this?


Hi Lauren,
I just tested this and found out that 'some' of the detail must be 'visible' in order for your code to work.
So if I just open the form (detail.invisible) with only the header shown then it won't work.
Same error as you indicate
When I go to design view and back to normal view it works (empty detail section is 'visible')
When I resize the form just a little bit before I click the button, the code works...

Workaround could be: Me.AutoResize = false... but you will 'see' the empty form.
I am not sure if this is what you want, because you could do the same by setting al controls to visible / invisible ?

Maybe you could just make the subformcontrol visible /invisible ?

--
Hope this helps
Arno R
Nov 13 '05 #2
Arno,
Thanks for the reply. After I pulled out some hair trying to figure
this out I too discovered it had to do with needing at least a sliver
of the detail section visible. I can't (don't want to actually) hide
the controls because there are so many of them. I prefer just to hide
the detail section.
It baffles my why Access returns an error that a control doesn't exisit
if the form is sized so that the detail section isn't showing.
My workaround was:
the form height = me.formheader.height + 200.
That leaves a sliver of the (invisible) detail section showing and
allows me to address the controls without error before I populate and
resize the form.
lq

Nov 13 '05 #3

"lauren quantrell" <la*************@hotmail.com> schreef in bericht news:11*********************@f14g2000cwb.googlegro ups.com...
It baffles my why Access returns an error that a control doesn't exisit
if the form is sized so that the detail section isn't showing.


It's just one of 'those things'.
We have to live with them don't we?
Access sometimes tries to be *too* helpful ...

Arno R
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Caroline Bradford | last post by:
Hi there, I wonder if there is a kind and knowledgeable person out there who can help me with a sticky problem. I have a form with a subform which shows detailed data. For complicated reasons,...
5
by: Lyn | last post by:
Hi, I have a form which contains a number of subforms in different pages of a tab control. In the detail section of each subform, I list records related to the main form record, but from...
6
by: Sally | last post by:
I need to be able to click in a subform and run code but at the same time I need to be able to scroll the records without running the code. I tried coding the Enter event of the subform control but...
1
by: John Phelan-Cummings | last post by:
I'm not certain if this made the post. Sorry if it's a repeat: Using a Button to take an autonumber from one form to populate another autonumber field on another form. I have a Mainform "A"...
2
by: Anthony England | last post by:
I wonder if anyone would have 5 minutes to check this for me. Access XP with new database created: Simple table tblTest: ID=autonumber, F1=Text with a few sample records frmSub has this as its...
1
by: dBNovice | last post by:
Please help! I have 3 forms: Task, Subtask, Elements. Elements is a subform of Subtask and Subtask is a subform of Task. I am able to navigate from Task to Subform to Element and from Element to...
1
by: abprules | last post by:
I am trying to tab from my header to my detail section in a form that includes a tabcontrol form. It is not working. Can anybody suggest something. I have tried the following: Add a text box to...
1
by: jeffro | last post by:
I have a database used for recording survey data. In the database, I have a form that displays a survey participant and a subform that is filled in by selecting a question from a looklist and...
5
Scott Price
by: Scott Price | last post by:
Hello, I'm running Access 2003 trying to filter a subform with approximately 15 records per year per the main record contained on the parent form. The filter works fine if the subform is opened...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.