Controls disappear when form is empty

  • Thread starter Thread starter MikeC
  • Start date Start date
M

MikeC

I'm developing a form in AXP that has multiple subforms.
The form works fine when it is opened in "Add/Edit/Delete"
mode. However, when I open the form in "read only" mode,
any subform that has no related records will display
without any controls (including command buttons). The
same will happen to the main form if the user
inadvertantly applies a filter that excludes all records.

The above behavior occurs *only if* the form is opened
in "read only" mode. This may be a built-in feature of
AXP, but I'd rather have the form behave as it does
in "Add/Edit/Delete" mode, except without the adding and
editing.

Does anyone know how to resolve this issue?

Below is the code that I'm using to open the form (from a
switchboard form):

' Open a form and set add/edit/delete mode
Case conCmdOpenFormBrowse
DoCmd.OpenForm rs![Argument]
Forms(rs![Argument]).Caption = Forms(rs!
[Argument]).Caption _
& " - Add/Edit/Delete"

' Open a form and set read only mode
Case conCmdOpenFormView
DoCmd.OpenForm rs![Argument],,,,acFormReadOnly
Forms(rs![Argument]).Caption = Forms(rs!
[Argument]).Caption _
& " - View Only"
 
Thanks for the info.

The suggested workaround solutions in KB 209734 are not
always feasible.

For instance, if the user inadvertently applies a filter
that excludes all records, the controls suddenly
disappear. This behavior is not the users' fault and I
wish to avoid punishing them for data issues they cannot
know in advance.

Is anyone aware of a programmatic workaround for this bug?

-----Original Message-----
Hi Mike,

This is a known issue -

Form Opened in Form View Is Completely Blank
http://support.microsoft.com/default.aspx?scid=kb;EN- US;93261

ACC2000: Form Opened in Form View Is Completely Blank
http://support.microsoft.com/?id=209734


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
I'm developing a form in AXP that has multiple subforms.
The form works fine when it is opened in "Add/Edit/Delete"
mode. However, when I open the form in "read only" mode,
any subform that has no related records will display
without any controls (including command buttons). The
same will happen to the main form if the user
inadvertantly applies a filter that excludes all records.

The above behavior occurs *only if* the form is opened
in "read only" mode. This may be a built-in feature of
AXP, but I'd rather have the form behave as it does
in "Add/Edit/Delete" mode, except without the adding and
editing.

Does anyone know how to resolve this issue?

Below is the code that I'm using to open the form (from a
switchboard form):

' Open a form and set add/edit/delete mode
Case conCmdOpenFormBrowse
DoCmd.OpenForm rs![Argument]
Forms(rs![Argument]).Caption = Forms(rs!
[Argument]).Caption _
& " - Add/Edit/Delete"

' Open a form and set read only mode
Case conCmdOpenFormView
DoCmd.OpenForm rs! [Argument],,,,acFormReadOnly
Forms(rs![Argument]).Caption = Forms(rs!
[Argument]).Caption _
& " - View Only"
.
 
I see your point. You can always set the AllowFilter property to false -
that will avoid inadvertant filtering. Still not a great solution though.

Another option is to leave the AllowEdits property of the form true but also
set the Locked Property of all controls to true. This protects the data and
prevents the blanked out form effect when no records match.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Thanks for the info.

The suggested workaround solutions in KB 209734 are not
always feasible.

For instance, if the user inadvertently applies a filter
that excludes all records, the controls suddenly
disappear. This behavior is not the users' fault and I
wish to avoid punishing them for data issues they cannot
know in advance.

Is anyone aware of a programmatic workaround for this bug?

-----Original Message-----
Hi Mike,

This is a known issue -

Form Opened in Form View Is Completely Blank
http://support.microsoft.com/default.aspx?scid=kb;EN- US;93261

ACC2000: Form Opened in Form View Is Completely Blank
http://support.microsoft.com/?id=209734


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
I'm developing a form in AXP that has multiple subforms.
The form works fine when it is opened in "Add/Edit/Delete"
mode. However, when I open the form in "read only" mode,
any subform that has no related records will display
without any controls (including command buttons). The
same will happen to the main form if the user
inadvertantly applies a filter that excludes all records.

The above behavior occurs *only if* the form is opened
in "read only" mode. This may be a built-in feature of
AXP, but I'd rather have the form behave as it does
in "Add/Edit/Delete" mode, except without the adding and
editing.

Does anyone know how to resolve this issue?

Below is the code that I'm using to open the form (from a
switchboard form):

' Open a form and set add/edit/delete mode
Case conCmdOpenFormBrowse
DoCmd.OpenForm rs![Argument]
Forms(rs![Argument]).Caption = Forms(rs!
[Argument]).Caption _
& " - Add/Edit/Delete"

' Open a form and set read only mode
Case conCmdOpenFormView
DoCmd.OpenForm rs! [Argument],,,,acFormReadOnly
Forms(rs![Argument]).Caption = Forms(rs!
[Argument]).Caption _
& " - View Only"
.
 
Hi,
You could always use this to inform the user that there are no records:
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "no records"
End If

--
HTH
Dan Artuso, Access MVP


MikeC said:
Thanks for the info.

The suggested workaround solutions in KB 209734 are not
always feasible.

For instance, if the user inadvertently applies a filter
that excludes all records, the controls suddenly
disappear. This behavior is not the users' fault and I
wish to avoid punishing them for data issues they cannot
know in advance.

Is anyone aware of a programmatic workaround for this bug?

-----Original Message-----
Hi Mike,

This is a known issue -

Form Opened in Form View Is Completely Blank
http://support.microsoft.com/default.aspx?scid=kb;EN- US;93261

ACC2000: Form Opened in Form View Is Completely Blank
http://support.microsoft.com/?id=209734


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
I'm developing a form in AXP that has multiple subforms.
The form works fine when it is opened in "Add/Edit/Delete"
mode. However, when I open the form in "read only" mode,
any subform that has no related records will display
without any controls (including command buttons). The
same will happen to the main form if the user
inadvertantly applies a filter that excludes all records.

The above behavior occurs *only if* the form is opened
in "read only" mode. This may be a built-in feature of
AXP, but I'd rather have the form behave as it does
in "Add/Edit/Delete" mode, except without the adding and
editing.

Does anyone know how to resolve this issue?

Below is the code that I'm using to open the form (from a
switchboard form):

' Open a form and set add/edit/delete mode
Case conCmdOpenFormBrowse
DoCmd.OpenForm rs![Argument]
Forms(rs![Argument]).Caption = Forms(rs!
[Argument]).Caption _
& " - Add/Edit/Delete"

' Open a form and set read only mode
Case conCmdOpenFormView
DoCmd.OpenForm rs! [Argument],,,,acFormReadOnly
Forms(rs![Argument]).Caption = Forms(rs!
[Argument]).Caption _
& " - View Only"
.
 
I like the idea about leaving the form in Edit mode while
locking the controls. That should emulate the intended
functionality without too much workaround effort. Thanks.
-----Original Message-----
I see your point. You can always set the AllowFilter property to false -
that will avoid inadvertant filtering. Still not a great solution though.

Another option is to leave the AllowEdits property of the form true but also
set the Locked Property of all controls to true. This protects the data and
prevents the blanked out form effect when no records match.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Thanks for the info.

The suggested workaround solutions in KB 209734 are not
always feasible.

For instance, if the user inadvertently applies a filter
that excludes all records, the controls suddenly
disappear. This behavior is not the users' fault and I
wish to avoid punishing them for data issues they cannot
know in advance.

Is anyone aware of a programmatic workaround for this bug?

-----Original Message-----
Hi Mike,

This is a known issue -

Form Opened in Form View Is Completely Blank
http://support.microsoft.com/default.aspx?scid=kb;EN- US;93261

ACC2000: Form Opened in Form View Is Completely Blank
http://support.microsoft.com/?id=209734


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

MikeC wrote:
I'm developing a form in AXP that has multiple subforms.
The form works fine when it is opened in "Add/Edit/Delete"
mode. However, when I open the form in "read only" mode,
any subform that has no related records will display
without any controls (including command buttons). The
same will happen to the main form if the user
inadvertantly applies a filter that excludes all records.

The above behavior occurs *only if* the form is opened
in "read only" mode. This may be a built-in feature of
AXP, but I'd rather have the form behave as it does
in "Add/Edit/Delete" mode, except without the adding and
editing.

Does anyone know how to resolve this issue?

Below is the code that I'm using to open the form (from a
switchboard form):

' Open a form and set add/edit/delete mode
Case conCmdOpenFormBrowse
DoCmd.OpenForm rs![Argument]
Forms(rs![Argument]).Caption = Forms(rs!
[Argument]).Caption _
& " - Add/Edit/Delete"

' Open a form and set read only mode
Case conCmdOpenFormView
DoCmd.OpenForm rs! [Argument],,,,acFormReadOnly
Forms(rs![Argument]).Caption = Forms(rs!
[Argument]).Caption _
& " - View Only"
.

.
 
Back
Top