M
Mary Ann
I have a database which has a contacts table and a
companies table with a one to many relationship between
contacts and companies. The database has been used so
far to send out mailshots to prospective subscribers to a
magazine.
I have a contacts form which includes a combo box to show
the contact's company. The combo box record source is a
query containing the company name and some address
fields - this is necessary because there are some
companies with the same name but different addresses.
I also have a companies form with a sub form containing
contact details.
My problem arises when I need to change the contact's
company. A contact phones to tell me they have changed
companies, I go to the contacts form, find the contact
and select the new company from the company combo list.
This is fine when the company already exists.
When the company does not exist yet, I need to create a
new company when the person is on the phone and then
update their record. I created a command button on the
contacts form, using the Wizard, which opens the
companies form so I can create a new company. I then
close the companies form and am returned to the contacts
form showing the correct person, but the companies combo
does not include the new company. I have tried including
a command button on the contacts form which "Refreshes
form data" but this does not make any difference.
If I close the contacts form and reopen it the newly
created company is present in the list - but I don't want
to have to do this as I am then not looking at the
correct contact record.
If anyone can help I would be most grateful. I am a
strongly competent user of Access but I don't write
Visual Basic.
Regards
Mary Ann
companies table with a one to many relationship between
contacts and companies. The database has been used so
far to send out mailshots to prospective subscribers to a
magazine.
I have a contacts form which includes a combo box to show
the contact's company. The combo box record source is a
query containing the company name and some address
fields - this is necessary because there are some
companies with the same name but different addresses.
I also have a companies form with a sub form containing
contact details.
My problem arises when I need to change the contact's
company. A contact phones to tell me they have changed
companies, I go to the contacts form, find the contact
and select the new company from the company combo list.
This is fine when the company already exists.
When the company does not exist yet, I need to create a
new company when the person is on the phone and then
update their record. I created a command button on the
contacts form, using the Wizard, which opens the
companies form so I can create a new company. I then
close the companies form and am returned to the contacts
form showing the correct person, but the companies combo
does not include the new company. I have tried including
a command button on the contacts form which "Refreshes
form data" but this does not make any difference.
If I close the contacts form and reopen it the newly
created company is present in the list - but I don't want
to have to do this as I am then not looking at the
correct contact record.
If anyone can help I would be most grateful. I am a
strongly competent user of Access but I don't write
Visual Basic.
Regards
Mary Ann