Record selector & New record

S

Scott

I am using record selectors on a subform with a tabular
view. I also have GotFocus and LostFocus procedures that
assign the contents of the control to a variable for
evaluation.

When I manually select the records, my procedures run.
But, when I use the record selector, they don't.

Does anyone know why this is and how I can get the
procedures to run with the record selector?
 
P

PC Datasheet

Put your code in the OnCurrent event of the form. The OnCurrent event fires each
time you go to a new or different record.
 
M

Marshall Barton

Scott said:
I am using record selectors on a subform with a tabular
view. I also have GotFocus and LostFocus procedures that
assign the contents of the control to a variable for
evaluation.

When I manually select the records, my procedures run.
But, when I use the record selector, they don't.

Does anyone know why this is and how I can get the
procedures to run with the record selector?


When you manually select a record with the mouse, you're
clicking on a control so the control gets the focus and your
GotFocus event runs. If you then use the navigation buttons
(at the nottom of the form), the same control (on a
different record) receives the focus.

But, when you click on a record selector, you are selecting
the entire record, so no control gets the focus.

You can track all this by placing MsgBox in the form's Click
and Current events and add other MsgBox to each of the
control's GotFocus events.

Another way to note the different circumstances is to use
your various selection methods and hit the Delete key. If
you click within a record (or use the tab key, etc), then
the Delete key will edit the value of a control. When you
click on a record selector, then the Delete key will delete
the entire record. When you use the Navigation buttons, the
form should stay in whatever "mode" it was in.

Confusing, isn't it. Maybe you should reconsider using
Record Selectors on your form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top