Add Command

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

Guest

My database consists of our clients, products, orders made for clients and
correspondence of the client (i.e., communications made with the client). We
have it set to where the correspondence is a word document, which is then
added as a hyperlink in access.

I have a form, which shows the clients table, with two command buttons. One
of the commands is to open the correspondence form, showing the
correspondence for that particular client, and the other command to add a
correspondence for the particular client.

I am having trouble with the add command. I have tried “strDocName =
“Correspondence†DoDmc.OpenForm strDocName, , acaAdd DoCmd Close acForm,
“Correspondenceâ€
But that flashes the “Correspondence†form.

The client table name is “Clients†as well as the forms name; correspondence
table name is “Correspondence†as well as the form name. The
“Correspondence†form consists of the ID #, Client Name, and the link to the
Word Document.

I hope I have been clear as what I am trying to do, you can e-mail me if
you'd like.
chipper919 at msn dot com. Thank you...
 
Hi, Chip.
But that flashes the “Correspondence†form.

If I understand correctly, you'd like to open the "Correspondence" form and
keep it open until the user is finished adding the new record, then return to
the "Clients" form. If so, then try the following syntax in your Add
button's OnClick( ) event:

Dim strDocName As String

strDocName = "Correspondence"
DoCmd.OpenForm strDocName, , , , acFormAdd, acDialog

When the user is finished adding the new record and closes the
"Correspondence" form, focus will return to the "Clients" form. The user
will not be able to use any other form until the "Correspondence" form is
closed, since this form will be open as a dialog window.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.
 
Thank you. It worked...
--
-Chip
=)


'69 Camaro said:
Hi, Chip.


If I understand correctly, you'd like to open the "Correspondence" form and
keep it open until the user is finished adding the new record, then return to
the "Clients" form. If so, then try the following syntax in your Add
button's OnClick( ) event:

Dim strDocName As String

strDocName = "Correspondence"
DoCmd.OpenForm strDocName, , , , acFormAdd, acDialog

When the user is finished adding the new record and closes the
"Correspondence" form, focus will return to the "Clients" form. The user
will not be able to use any other form until the "Correspondence" form is
closed, since this form will be open as a dialog window.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.
 
Back
Top