Subform - lookup/add new

G

Guest

Hi

i have some solutions but i am looking for more ideas on ho to go about it.
I have a form that is a Claim. each claim involves an employee. the employee
should be entered if there were no other claims for this employee. so
employee is related to claim one-to-many. the main form's datasource is a
query that has the claim table and employee table. i am trying to set up
either a subform or part of the main form a way that an employee can be
looked up and if not found entered.

this what i have now. a combo showing all existing employees. i then have a
tab control, the first tab showing the existing employees. if a new employee
is to be entered then the second tab comes up (seamlessly, not visible that
there are two tabs) which has a subform. tab1 has bounded fields, and tab2
(the subform) has unbounded fields. so in order to gather the info of tab2, a
long sub has to be written.

any ideas on how to do this in a less complicated way?

thanks,

sam
 
G

Guest

This is a typical Form/SubForm issue.
Your Form should be based on the Employee table.
Your SubForm should be based on the Claim table.

You can use the Not In List event of your existing combo to open a form to
enter new employee information.

If you want to open a different form to do data entry on a claim, you can
put a command button on the Form that will open a claim data entry form with
the current record of the subform as it's current record, or for a new record
use a different command button that will open the claim data entry form in
data entry mode.

Note this is a broad overview of the technique, there will be detail issues
to deal with.
 
G

Guest

Thanks for you quick reply. However, i didn't explain that the claim form
most be the main form. there are claim details which is a subform. there is
also, another section which is company details which i incorporated in the
main form (its related to claim - its part of the query of the main form).

sam
 
G

Guest

You post was clear. The Claim form can be the main form once you have
selected an Employee. Using what I suggested as the original will allow you
to select the employee and if the employee has any extisting claim records,
it will show those in the sub form. The you can use one of the command
buttons I suggested to either open your Claim form with the selected claim or
start a new claim. It probably would not be necessary to have the claim
detail at this level, if it is, then a sub form can have a sub form.

This will really have no effect on your current Claim form. It will only
provide you a way to select the employee and claim you want to work with.
 

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