L
LGC
Hello All:
I have a form bound to an updateable query. In the footer of the form I
have a row of unbound textbox controls that I use for data input. I trap
keystrokes on most of these controls to aid in data entry by restricting
invalid data and acting as an input mask. For example, on some of the
controls I trap the plus and minus keys to scroll through a list of valid
entries. Most of the data is numeric and this allows the user to enter all
of the data using the numeric keypad. One of the textbox control's data
source is set to a DLookup function using one of the textbox's value as
criteria.
Everything works as expected unless there are no records in the form's
record source. In this case I observe the following regarding the unbound
controls:
1. I get an error trying to reference the SelStart and SelLength properties
in the GotFocus event procedure. ("You can't reference a property or method
for a control unless the control has the focus") This error occurs when
tabbing into the control or setting the focus in code.
2. Any changes I make to the control's value in code does not appear until
select another application and then reselect the form.
3. The Lookup function does not work at all (with valid data as criteria),
even when reselecting the form.
Again, everything works fine when there is at least one record in the form's
record source. I would appreciate any input on a solution or what I may
have done to cause the problem.
Thank you.
LaVern
I have a form bound to an updateable query. In the footer of the form I
have a row of unbound textbox controls that I use for data input. I trap
keystrokes on most of these controls to aid in data entry by restricting
invalid data and acting as an input mask. For example, on some of the
controls I trap the plus and minus keys to scroll through a list of valid
entries. Most of the data is numeric and this allows the user to enter all
of the data using the numeric keypad. One of the textbox control's data
source is set to a DLookup function using one of the textbox's value as
criteria.
Everything works as expected unless there are no records in the form's
record source. In this case I observe the following regarding the unbound
controls:
1. I get an error trying to reference the SelStart and SelLength properties
in the GotFocus event procedure. ("You can't reference a property or method
for a control unless the control has the focus") This error occurs when
tabbing into the control or setting the focus in code.
2. Any changes I make to the control's value in code does not appear until
select another application and then reselect the form.
3. The Lookup function does not work at all (with valid data as criteria),
even when reselecting the form.
Again, everything works fine when there is at least one record in the form's
record source. I would appreciate any input on a solution or what I may
have done to cause the problem.
Thank you.
LaVern