Open a form within a form with new record

S

Sylvie

On my form, there is a combo box with a drop down list of customers the user
can pick. If the customer is not part of the list, there is a button to click
and it will open the customer details form where the user can enter
information about the new customer. I create the button using the wizard
since i'm not good in vba,the problem is it does not open an empty record of
the customer details form. How can i make it happen?
and how do yo make the name appear on the combo drop down list once it has
been created? I'm using Access2007.
Here is the macro:
openform, customersdetail, form,,,,Normal

In advance, Thank you very much for any help
 
S

Sylvie

Thank you Steve for a quick answer and solution. Yes, it creates a new record
but it does not add it to the combo unless i close the form and reopen it.
How can it add it automatically? thx
 
S

Sylvie

Thank you Steve for a quick answer and solution. Yes, it creates a new record
but it does not add it to the combo unless i close the form and reopen it.
How can it add it automatically? thx
 
B

Beetle

Open the customer details form in Dialog mode;

OpenForm, customersdetail, Form,,, Add, Dialog

Then add another line to the macro to requery the combo box;

Requery, [NameOfYourComboBox]

If you are using code and not a macro, the line would look like;

Me![NameOfYourComboBox].Requery

(use the actual name of your combo in the above examples)

With the customer detail form opened in dialog mode, the second line
of the macro (or code) won't execute until after the customer detail form
is closed.
 
S

Sylvie

Awesome! that works great. Thank you so much.

Beetle said:
Open the customer details form in Dialog mode;

OpenForm, customersdetail, Form,,, Add, Dialog

Then add another line to the macro to requery the combo box;

Requery, [NameOfYourComboBox]

If you are using code and not a macro, the line would look like;

Me![NameOfYourComboBox].Requery

(use the actual name of your combo in the above examples)

With the customer detail form opened in dialog mode, the second line
of the macro (or code) won't execute until after the customer detail form
is closed.

--
_________

Sean Bailey


Sylvie said:
Thank you Steve for a quick answer and solution. Yes, it creates a new record
but it does not add it to the combo unless i close the form and reopen it.
How can it add it automatically? thx
 

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