>Hello
>I have a form with a button to send him by e-mail to another person. When I
[quoted text clipped - 3 lines]
>send by mail?Could that e-mailButton be used again when I press "New
>Registry" with new auto number?
You can "lock" the form by setting the AllowAdditions, AllowEdits, and AllowDeletions property of the form as needed.
You'd do this AFTER the email is sent:
<your email code>
Me.AllowEdits=False
Me.AllowDeletions=False
You'd need to reset those properties in the Form's Current event, however, in order for users to be able to interact
with other records (if that's relevant).
However, if you want to "save" this setting, you'll need some column in your table that lets you know when the email has
been sent ... for example, if you have a dteEmailSent field to store the date, you could check that in the Current event
and see if the form needs to be "locked".
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
Adamfunchal - 28 May 2007 09:51 GMT
Hello
I've this code for the "emailButton"
Private Sub Comando37_Click()
On Error GoTo Err_Comando37_Click
Dim stDocName As String
stDocName = "Enviar por correio"
DoCmd.RunMacro stDocName
Me.AllowEdits = False
Me.AllowDeletions = False
Exit_Comando37_Click:
Exit Sub
Err_Comando37_Click:
MsgBox Err.Description
Resume Exit_Comando37_Click
End Sub
And its not working correctly. After press "Commando37" (emailButton) I can
Edit, delete or whatever I want.
Whats Wrong?
> >Hello
> >I have a form with a button to send him by e-mail to another person. When I
[quoted text clipped - 21 lines]
> scott@takemeout_infotrakker.com
> www.infotrakker.com
Adamfunchal - 31 May 2007 09:11 GMT
Someone can Help me?
Thanks
Scott McDaniel - 31 May 2007 10:58 GMT
>Hello
>I've this code for the "emailButton"
[quoted text clipped - 20 lines]
>Edit, delete or whatever I want.
>Whats Wrong?
What does your macro "stDocName" do?
The code you have listed would NOT allow Edits or Deletions, but would allow new records to be added.
If you'd rather, you could instead disable and lock all controls after running your macro:
Dim ctl As Control
On Error Resume Next
For each ctl in Me.Controls
ctl.Enabled = False
ctl.Locked = True
Next ctl
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
Adamfunchal - 31 May 2007 16:12 GMT
"What does your macro "stDocName" do?"
this macro opens a report and then send that report by e-mail.
I tried this code:
> Dim ctl As Control
>
[quoted text clipped - 3 lines]
> ctl.Locked = True
> Next ctl
But it locks everything after "send by mail" but I want to insert a new
registry with new "auto number" and then send again by e-mail.