Opening form with a button in another form

  • Thread starter Thread starter Eva
  • Start date Start date
E

Eva

I'm having a problem opening a sub form with a button.
The main form has client information and when I open the
sub form (with a button) I need it to pull up all the
records that are connected to that Client ID. If the
client ID is already entered in the sub table there is no
problem, however I need the sub form to also create new
records that automatically contain the appropriate client
ID. I hope I'm explaining this correctly. I'm using the
wizard to create the button and am not very experienced
with visual basic.

Thanks for any help.

Eva
 
i'm not sure what you mean by "opening a sub form with a
button". a subform is a control object in the main form.
it automatically "opens" in the main form, when the main
form opens.
do you mean that you have a button on one form to open
another form IN ANOTHER WINDOW? if so, you can do one of
two things i can think of right off the bat.
1. add the second form to the first form, as a true
subform, and set the Link Child Fields and Link Master
Fields to reflect the relationship between the ClientID
and the child records.
2. leave the second form as a separate form. in the form's
BeforeUpdate event, add the following
***air code***
Me!ClientID = Forms!MainFormName!ClientID
***air code***

hth
 
Back
Top