Form-->Subform: How to pre-populate new subform record?

floridaboy2004

New Member
Joined
Nov 17, 2004
Messages
44
Hello,

I have a database tracking customers by customer #. I have created a subform that has individual personal preferences data for each customer. I have created a button on the parent form that opens the subform and it is pre-loading the customer # fine.

However, is there a way to create a button on the parent form that will open the subform and create a new record, already pre-populated with a customer #? Each customer may have several records on the subform, e.g. one record for store visit #1, store visit #2, etc.

Also, is there a way to create a field that will allow me to search by customer # on the parent form and/or a button on the subform as well? Thanks, all! :)
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Re: Form-->Subform: How to pre-populate new subform recor

Anyone, please? I really need to figure out how to achieve this...

Also, is what type/sort of command would I need to do to 'black-out' all boxes that occur AFTER a particular choice is made? For example, if I check "Y" for box #3 (diabetic customer), how could I 'grey out' boxes 3, 4, and 5 that ask about their favorite candies?

Please be as specific as possible...esp. with what menus, etc. to use.

Thanks, all! :)
 
Upvote 0
Re: Form-->Subform: How to pre-populate new subform recor

Hi, in answer to this question :
However, is there a way to create a button on the parent form that will open the subform and create a new record, already pre-populated with a customer #?

If you have already created a button with a macro attached, you could add two more lines to your macro and use the following Commands GoTo Control -> [your subform name], GoTo Record -> New.

Also, is there a way to create a field that will allow me to search by customer # on the parent form and/or a button on the subform as well?

Have you considered using a drop down combo box on the main form? I'm not so sure if this can be done on the subform though .... someone please correct me if I am wrong.

HTH, Andrew. :)
 
Upvote 0

Forum statistics

Threads
1,221,829
Messages
6,162,229
Members
451,756
Latest member
tommyw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top