Creating a New Record

Little_Man22

Registered User.
Local time
Today, 08:17
Joined
Jun 23, 2001
Messages
118
This could get tricky...

I have a main form (frmclients) which contains all of a clients info. Within this form there are various pages, one of which contains all of the clients insurance policies. This page is simply a subform (frmpolicy) inserted into the main form. You can navigate the clients policies using the arrows to tab from policy to policy.

However, I'm interested in attempting to add a new policy to the client through code. What I need is some type of control button, that when pushed, will create a new record within this subform...

How do I do this (i.e what does the code look like). I need it to basically say 'create new record under forms!frmclients!subformpolicies!....

Thanks in advance,
Ryan.
 
This is just a thought, but it might be possible to create a form header in the subform (separate from the detail section) and put a command button to add a new record directly in the sub-form. Then you would have to follow back the .Parent property to find the parent form to get the name from the control that drove the original sub-form selection.

Hope I stated that clearly enough, and I'm not going to swear it would work correctly. But if it does, then the sub-form is intercepting the command button in its own context so you don't have to do quite so much. In fact, in that circumstance, it might even correctly fill in the client name for you, though I'm not putting money on it.
 

Users who are viewing this thread

Back
Top Bottom