SubForm does not accept focus when adding a new record ?

G

Greg (codepug

My subform control will not accept focus when adding a New Record in
the parent main form.
The main form (single form) has a SubForm (continuous form) placed on
it. The main form displays an individual sick leave occurrence, the
subform is linked (parent/child) and displays all sick leave
occurrences for that individual. This works fine. I need the ability
to scroll through the subform to view all sick leave occurrences for
any one individual that is being displayed on the main form. Again,
this works fine. The problem is when a new record is being created,
the subform no longer accepts focus for scrolling through the
individuals past sick leave history. The link works, since the
individuals records do show in the subform window, but I cannot get
focus on the subform to scroll through the records by mouse. The
subform just seems frozen. Therefore I cannot view the individuals
history when adding the new record. This occurs when a new record is
created and becomes dirty. Once the new record becomes dirty, the
subform seems frozen, and does not allow me to scroll or get focus.

Is this normal behavior? If so, how do I accomplish my goal?
Others have posted this problem, but no viable solution was posted!
A button with a popup of the same subform works, but the same form
embedded does not?

Thanks
Greg
 
J

Jeanette Cunningham

hi Greg,
not sure just how your form is set up.
If your main form was based on a table of employees, and the subform was
based on a table of sick leave for the same employee, I would think that you
could see all sick leave for that employee and also add a new sick leave
record without those problems.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
G

Greg (codepug

Thanks Jeanette

My MainForm is based on a query, with the primary table of SickLeave
and adjoining table of Employee. The Main form displays sickleave
occurences for various employees. The mainform, when adding a new
sickleave record, uses a combobox to select the employee (EMPID). The
child/parent link in the subform in turn displays the history of
sickleave occurences for the given employee. Yes, I can see the
sickleave records in the subform for the employee. But, I cannot
scroll because the subform will not accept focus from my mouse, during
the new record
process.

Thanks Greg
 
J

Jeanette Cunningham

Greg,
My suggestion is to base the main form on a query on the employee table and
the subform on a query on the sick leave table, and let access get the
related records through the link master and child fields.

This way you can choose an employee from a drop down for the main form and
the subform will show all the sickleave records for that employee.
You would add a new sickleave record on the subform - which would add that
sickleave record to the employee that the main form is showing.

This may not be your preferred form setup, but it will let access work
easily for you instead of against you.
This would be fairly easy to set up and code, easier than the problem you
have with your current setup.
This form and subform I have described mimics the table relationships where
employees can have many sickleave records.
This is a one to many relationship, and I suggest you set the form up so
that the main form is for the one side of the relationship and the subform
is for the many side of the relationship - this is one of the things that
access does very well - as long as you choose the table on the one side for
the main form and the table on the many side as the subform.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

Thanks Jeanette

My MainForm is based on a query, with the primary table of SickLeave
and adjoining table of Employee. The Main form displays sickleave
occurences for various employees. The mainform, when adding a new
sickleave record, uses a combobox to select the employee (EMPID). The
child/parent link in the subform in turn displays the history of
sickleave occurences for the given employee. Yes, I can see the
sickleave records in the subform for the employee. But, I cannot
scroll because the subform will not accept focus from my mouse, during
the new record
process.

Thanks Greg
 
G

Greg (codepug

Thank you for the advice Jeanette. It appears I'll have to rethink
this !

Greg
 

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