At the end of a bit of vba code, I open a form using:
DoCmd.OpenForm "frmResultsComparedToGoal", acNormal
The form has started opening like this
I have tried opening the form in acDesign mode, then acNormal.
I have tried .Requery on the forms recordsetclone.
I have tried opening the form in acNormal, then acDesign mode, then acNormal.
I have put a 1 second delay before the 2nd re-opening.
None of that makes any difference.
If I manually close the form then manually re-open it it looks as it should, like this
The record source table is:
I'm stumped. What am I doing wrong?
Why won't this form open correctly?
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Why won't this form open correctly?
You do not have the required permissions to view the files attached to this post.
Avagr8day, regards, Peter
-
- Administrator
- Posts: 78608
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Why won't this form open correctly?
What happens if you clear the record source of the form in design view, and instead set the RecordSource property in the On Open (or On Load) event of the form?
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: Why won't this form open correctly?
Unfortunately that made no diff.
I am biting the bullet and not opening that form by vba. I will insert a message box advising to open the form manually.
Don't like workarounds, but sometimes .....
Thanks anyway Hans.
I am biting the bullet and not opening that form by vba. I will insert a message box advising to open the form manually.
Don't like workarounds, but sometimes .....
Thanks anyway Hans.
Avagr8day, regards, Peter
-
- 3StarLounger
- Posts: 308
- Joined: 24 Dec 2015, 16:41
Re: Why won't this form open correctly?
the open form event is occuring before its record source is available
to debug; rather that trigger the open form - instead trigger the open of the record source - - that should tell you something.
to debug; rather that trigger the open form - instead trigger the open of the record source - - that should tell you something.
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: Why won't this form open correctly?
Thanks CD. It appears to have fixed itself. Absolutely no idea how. The record source is a table, opening (and opening & closing) that before opening the form made no diff.
Avagr8day, regards, Peter
-
- 3StarLounger
- Posts: 308
- Joined: 24 Dec 2015, 16:41
Re: Why won't this form open correctly?
if it is a linked table - then there could have been a glitch in the network....
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: Why won't this form open correctly?
It isn't a linked table. All tables are in this Db. So no network.
So still strange.
So still strange.
Avagr8day, regards, Peter