dynamically change sub form (using code) on button click...

  • Thread starter Thread starter Philip
  • Start date Start date
P

Philip

Hi,

I have a form and the subform allows users to view data or modify data in
the table.

But for adding new records, I want a simplified view of the table, with only
therequired columns to be shown in the sub-form.

How can I either change the subform to be opened when the user clicks 'Add
New' or hide all the fields that are optional?

thanks

Philip
 
You can change the form serving as the SourceObject of the subform easily
enough by including :

Me.MySubForm.SourceObject = "frmMySubForm"

in the OnClick event of the "Add New" command button on the main form.

-Jeff
 

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

Back
Top