Coding newbie requests help.

S

Sue

I have a main form in my Contacts database. I have forms allowing for new
entries in tblContactType, tblBusiness, tblCity, & tblZipCode for
ContactType (i.e. Church, Bankiing/Finance, Medical, Insurance),
BusinessName, City, & Zip/PostalCode respectiveliy.

I've added command buttons which allow each of the above forms to be opened,
but the forms open to a record which has existing data rather than to a
blank record. Therefore there's a risk that a user will inadvertently
overwrite existing data. Also, once the new data is entered and the form is
closed, although the user returns to the form in which (s)he was entering
data, the form needs to be "refreshed" before the new entry (city, zip,
whatever) can be entered.

I want to be able to put a command button on my main form to allow the user
to do the following:
1) Open the form which enables a new entry in one of the above categories
2) Go straight to a blank record rather than to a record where an entry has
already been made (to avoid overwriting existing data)
3) Close the form they've used to add the new data
4) Return to the main form
5) Complete data entry without having to refresh the form & relocate the
record they were updating.

Can do?
 
D

Damon Heron

The simplest way is on the click event of your command button:

DoCmd.openform "name or your frm", acNormal, , , acFormAdd, acDialog
Me.[YourID].Requery ' this is the part of your form that needs to be
refreshed

I am wondering, however, why you have multiple forms to add to the main
form? Are these comboboxes on the main form that are filled with selections
for completing the main form? For instance, tblCity has a combobox that
user can select from and the form you are calling is a form to fill in a new
city.??? If so, then my solution above will work fine, just use the ID
field of your combobox to requery.

HTH
Damon
 
S

Sue

Hi Damon - thanks for your reply.
Yes, I'm using combo boxes in the fashion you described.
I tried your suggestion but I'm getting an error message.
Here's what I typed:

DoCmd.openform "frmAddBusiness", acNormal, , , acFormAdd, acDialog
Me.[Business_ID].Requery '

Is this correct?Did I understand you properly?

The error message I get is:

Microsoft Access can't find the field "?" referred to in your expression.

Any idea what I'm doing wrong?

Appreciate the help.

Damon Heron said:
The simplest way is on the click event of your command button:

DoCmd.openform "name or your frm", acNormal, , , acFormAdd, acDialog
Me.[YourID].Requery ' this is the part of your form that needs to be
refreshed

I am wondering, however, why you have multiple forms to add to the main
form? Are these comboboxes on the main form that are filled with
selections for completing the main form? For instance, tblCity has a
combobox that user can select from and the form you are calling is a form
to fill in a new city.??? If so, then my solution above will work fine,
just use the ID field of your combobox to requery.

HTH
Damon


Sue said:
I have a main form in my Contacts database. I have forms allowing for new
entries in tblContactType, tblBusiness, tblCity, & tblZipCode for
ContactType (i.e. Church, Bankiing/Finance, Medical, Insurance),
BusinessName, City, & Zip/PostalCode respectiveliy.

I've added command buttons which allow each of the above forms to be
opened, but the forms open to a record which has existing data rather
than to a blank record. Therefore there's a risk that a user will
inadvertently overwrite existing data. Also, once the new data is entered
and the form is closed, although the user returns to the form in which
(s)he was entering data, the form needs to be "refreshed" before the new
entry (city, zip, whatever) can be entered.

I want to be able to put a command button on my main form to allow the
user to do the following:
1) Open the form which enables a new entry in one of the above categories
2) Go straight to a blank record rather than to a record where an entry
has already been made (to avoid overwriting existing data)
3) Close the form they've used to add the new data
4) Return to the main form
5) Complete data entry without having to refresh the form & relocate the
record they were updating.

Can do?
 
D

Damon Heron

try removing the [] brackets.

Damon

Sue said:
Hi Damon - thanks for your reply.
Yes, I'm using combo boxes in the fashion you described.
I tried your suggestion but I'm getting an error message.
Here's what I typed:

DoCmd.openform "frmAddBusiness", acNormal, , , acFormAdd, acDialog
Me.[Business_ID].Requery '

Is this correct?Did I understand you properly?

The error message I get is:

Microsoft Access can't find the field "?" referred to in your expression.

Any idea what I'm doing wrong?

Appreciate the help.

Damon Heron said:
The simplest way is on the click event of your command button:

DoCmd.openform "name or your frm", acNormal, , , acFormAdd, acDialog
Me.[YourID].Requery ' this is the part of your form that needs to be
refreshed

I am wondering, however, why you have multiple forms to add to the main
form? Are these comboboxes on the main form that are filled with
selections for completing the main form? For instance, tblCity has a
combobox that user can select from and the form you are calling is a form
to fill in a new city.??? If so, then my solution above will work fine,
just use the ID field of your combobox to requery.

HTH
Damon


Sue said:
I have a main form in my Contacts database. I have forms allowing for new
entries in tblContactType, tblBusiness, tblCity, & tblZipCode for
ContactType (i.e. Church, Bankiing/Finance, Medical, Insurance),
BusinessName, City, & Zip/PostalCode respectiveliy.

I've added command buttons which allow each of the above forms to be
opened, but the forms open to a record which has existing data rather
than to a blank record. Therefore there's a risk that a user will
inadvertently overwrite existing data. Also, once the new data is
entered and the form is closed, although the user returns to the form in
which (s)he was entering data, the form needs to be "refreshed" before
the new entry (city, zip, whatever) can be entered.

I want to be able to put a command button on my main form to allow the
user to do the following:
1) Open the form which enables a new entry in one of the above
categories
2) Go straight to a blank record rather than to a record where an entry
has already been made (to avoid overwriting existing data)
3) Close the form they've used to add the new data
4) Return to the main form
5) Complete data entry without having to refresh the form & relocate the
record they were updating.

Can do?
 
D

Damon Heron

Oh, and Business_ID is the NAME of the combobox on the main form, correct?
Damon

Sue said:
Hi Damon - thanks for your reply.
Yes, I'm using combo boxes in the fashion you described.
I tried your suggestion but I'm getting an error message.
Here's what I typed:

DoCmd.openform "frmAddBusiness", acNormal, , , acFormAdd, acDialog
Me.[Business_ID].Requery '

Is this correct?Did I understand you properly?

The error message I get is:

Microsoft Access can't find the field "?" referred to in your expression.

Any idea what I'm doing wrong?

Appreciate the help.

Damon Heron said:
The simplest way is on the click event of your command button:

DoCmd.openform "name or your frm", acNormal, , , acFormAdd, acDialog
Me.[YourID].Requery ' this is the part of your form that needs to be
refreshed

I am wondering, however, why you have multiple forms to add to the main
form? Are these comboboxes on the main form that are filled with
selections for completing the main form? For instance, tblCity has a
combobox that user can select from and the form you are calling is a form
to fill in a new city.??? If so, then my solution above will work fine,
just use the ID field of your combobox to requery.

HTH
Damon


Sue said:
I have a main form in my Contacts database. I have forms allowing for new
entries in tblContactType, tblBusiness, tblCity, & tblZipCode for
ContactType (i.e. Church, Bankiing/Finance, Medical, Insurance),
BusinessName, City, & Zip/PostalCode respectiveliy.

I've added command buttons which allow each of the above forms to be
opened, but the forms open to a record which has existing data rather
than to a blank record. Therefore there's a risk that a user will
inadvertently overwrite existing data. Also, once the new data is
entered and the form is closed, although the user returns to the form in
which (s)he was entering data, the form needs to be "refreshed" before
the new entry (city, zip, whatever) can be entered.

I want to be able to put a command button on my main form to allow the
user to do the following:
1) Open the form which enables a new entry in one of the above
categories
2) Go straight to a blank record rather than to a record where an entry
has already been made (to avoid overwriting existing data)
3) Close the form they've used to add the new data
4) Return to the main form
5) Complete data entry without having to refresh the form & relocate the
record they were updating.

Can do?
 

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