Updating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a form (Invoice) on this form you can select a company to invoice.
However, sometimes the company you want is a new one and not listed. I have
put a button on the form to add a new company (it opens the company form so
that new info can be entered) but when I close the company form and try to
select it from the drop down list of companies, it's not there!

I have to close the form and reopen it to make the new company appear in the
list. As this is very cumbersome is there a way I can make it appear in the
list without closing it and reopening.

PS i don't know how to do code.

Thanks for taking the time to read my problem. Cheers
 
pjd said:
Hi

I have a form (Invoice) on this form you can select a company to
invoice. However, sometimes the company you want is a new one and not
listed. I have put a button on the form to add a new company (it
opens the company form so that new info can be entered) but when I
close the company form and try to select it from the drop down list
of companies, it's not there!

I have to close the form and reopen it to make the new company appear
in the list. As this is very cumbersome is there a way I can make it
appear in the list without closing it and reopening.

PS i don't know how to do code.

Thanks for taking the time to read my problem. Cheers

Are you willing to write a little code? If so, please post the names of
the two forms -- "Invoice" and ... ? "Company"? -- and the name of the
combo box on the Invoice form that you use to select the company. I'll
guide you through it.
 
Hi

I'm game if you are!

The invoice form is called "Frm Invoice" and the company form is called
"Company" and the name of the combo box is "SupplierName"

Thanks
 
pjd said:
Hi

I'm game if you are!

The invoice form is called "Frm Invoice" and the company form is
called "Company" and the name of the combo box is "SupplierName"

Thanks

Okay, here we go. <g>

1. Open the "Company" form in design view.

2. Open the property sheet of the form. Click on the Event tab.

3. On the line of the property sheet where it says "On Close",
double-click. The line should now say "[Event Procedure]", and a little
button with a caption of "..." should appear at the end of the line.

4. That little button is the "build" button. Click it.

5. The VB Editor window will now open, displaying the class module for
the form, and you'll see the shell of an event procedure that will look
like this:

Private Sub Form_Close()

End Sub

6. Insert the lines you'll see below so that it looks like this:

Private Sub Form_Close()

On Error Resume Next
Forms!Frm_Invoice!SupplierName.Requery

End Sub

7. Close the module window, close the VB Editor window, save the form,
and close it.

8. Now open your Frm_Invoice, click the button to open the Company form,
add a new company, close the Company form, and check the combo box on
Frm_Invoice. If all has gone well, you'll see the new company in the
list.
 
Mr Goldgar

I think I'm in-loooove!!

It worked brilliantly!!

Thanks for taking the time to help me out. It's really appreciated!

Dirk Goldgar said:
pjd said:
Hi

I'm game if you are!

The invoice form is called "Frm Invoice" and the company form is
called "Company" and the name of the combo box is "SupplierName"

Thanks

Okay, here we go. <g>

1. Open the "Company" form in design view.

2. Open the property sheet of the form. Click on the Event tab.

3. On the line of the property sheet where it says "On Close",
double-click. The line should now say "[Event Procedure]", and a little
button with a caption of "..." should appear at the end of the line.

4. That little button is the "build" button. Click it.

5. The VB Editor window will now open, displaying the class module for
the form, and you'll see the shell of an event procedure that will look
like this:

Private Sub Form_Close()

End Sub

6. Insert the lines you'll see below so that it looks like this:

Private Sub Form_Close()

On Error Resume Next
Forms!Frm_Invoice!SupplierName.Requery

End Sub

7. Close the module window, close the VB Editor window, save the form,
and close it.

8. Now open your Frm_Invoice, click the button to open the Company form,
add a new company, close the Company form, and check the combo box on
Frm_Invoice. If all has gone well, you'll see the new company in the
list.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
and a programmer is born! Good on ya!

Dirk Goldgar said:
pjd said:
Hi

I'm game if you are!

The invoice form is called "Frm Invoice" and the company form is
called "Company" and the name of the combo box is "SupplierName"

Thanks

Okay, here we go. <g>

1. Open the "Company" form in design view.

2. Open the property sheet of the form. Click on the Event tab.

3. On the line of the property sheet where it says "On Close",
double-click. The line should now say "[Event Procedure]", and a little
button with a caption of "..." should appear at the end of the line.

4. That little button is the "build" button. Click it.

5. The VB Editor window will now open, displaying the class module for
the form, and you'll see the shell of an event procedure that will look
like this:

Private Sub Form_Close()

End Sub

6. Insert the lines you'll see below so that it looks like this:

Private Sub Form_Close()

On Error Resume Next
Forms!Frm_Invoice!SupplierName.Requery

End Sub

7. Close the module window, close the VB Editor window, save the form,
and close it.

8. Now open your Frm_Invoice, click the button to open the Company form,
add a new company, close the Company form, and check the combo box on
Frm_Invoice. If all has gone well, you'll see the new company in the
list.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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