B
Brian
Why is it that Access changes the behavior of unbound controls just because
AllowAdditions = False?
I have a bound continuous form that is used only for filtering & sorting
data for reporting purposes. The form header has several combo boxes that are
used for the user to select filters, which are then applied to the form (&
the form is consequently requeried) in the AfterUpdate of each of them.
In the KeyPress event of each of those combo boxes, I have this:
ControlDropdown (ASCII)
which in turn reference this public function:
Public Function ControlDropDown(Keystroke As Integer)
If Len(Screen.ActiveControl.Text) = 0 Then
Select Case Keystroke
Case 9, 13, 27 'ignore TAB, ENTER, ESC
Case Else
Screen.ActiveControl.Dropdown
End Select
End If
End Function
This has the net effect of dropping it down on the first keypress.
When I set the form's AllowAdditions property to False (for the sole purpose
of preventing the {AutoNumber} text in the PK field on a blank line at the
bottom of the form), then I get this behavior:
When I enter something in Control#1 & press Tab to navigate to Control#2
(both unbound on the form header), I get a message that I cannot reference
the property of Control #1 when it does not have the focus; that is, it
attempts to take the Tab keypress in Control #1 and apply the ActiveControl
to the wrong object (Control#2)
AllowAdditions also seems to prevent the refresh of the date-related filters
I set on button clicks. For example, a "This Month" button sets the values
of a BeginDate & EndDate control to the first & last days of the current
month, respectively. When I se the form's AllowAdditions (or Recordset to
Snapshot), the content of BeginDate & EndDate do not display until I click in
the box.
If I could find a way to simply load up the form as unbound, I guess I would
not have this problem (no need for AllowAdditions = True).
AllowAdditions = False?
I have a bound continuous form that is used only for filtering & sorting
data for reporting purposes. The form header has several combo boxes that are
used for the user to select filters, which are then applied to the form (&
the form is consequently requeried) in the AfterUpdate of each of them.
In the KeyPress event of each of those combo boxes, I have this:
ControlDropdown (ASCII)
which in turn reference this public function:
Public Function ControlDropDown(Keystroke As Integer)
If Len(Screen.ActiveControl.Text) = 0 Then
Select Case Keystroke
Case 9, 13, 27 'ignore TAB, ENTER, ESC
Case Else
Screen.ActiveControl.Dropdown
End Select
End If
End Function
This has the net effect of dropping it down on the first keypress.
When I set the form's AllowAdditions property to False (for the sole purpose
of preventing the {AutoNumber} text in the PK field on a blank line at the
bottom of the form), then I get this behavior:
When I enter something in Control#1 & press Tab to navigate to Control#2
(both unbound on the form header), I get a message that I cannot reference
the property of Control #1 when it does not have the focus; that is, it
attempts to take the Tab keypress in Control #1 and apply the ActiveControl
to the wrong object (Control#2)
AllowAdditions also seems to prevent the refresh of the date-related filters
I set on button clicks. For example, a "This Month" button sets the values
of a BeginDate & EndDate control to the first & last days of the current
month, respectively. When I se the form's AllowAdditions (or Recordset to
Snapshot), the content of BeginDate & EndDate do not display until I click in
the box.
If I could find a way to simply load up the form as unbound, I guess I would
not have this problem (no need for AllowAdditions = True).