PDA

View Full Version : E-mail through form or report



wasim_sono
06-11-2008, 02:53 AM
Dear All

I'm designing a form and want to email the contents to any recipient or a set of recipients. whats is procedure? If VBA involves then please refer the code.
Similarly I want to assign rights to different users as their responsibilities.

Its a very high priority query. So please please reply early as possible and if dont mind then give email address which enable me to contact directly with you and several times in a day.

Thanks.

Wasim

CreganTur
06-11-2008, 05:19 AM
Deleted duplicate post

CreganTur
06-11-2008, 05:24 AM
The code below will create a new mail instance of Outlook. In its current version you can pass values for strSubject, strBody, and strRecipient which will allow you to set the E-mail's subject line, the text of the body, and who you're sending it to.

Sub CreateOutlookEmail(strSubject As String, strBody As String, strRecipient As String)
Dim appOutlook As Outlook.Application
Dim objNameSpace As Outlook.Namespace
Dim objMailItem As Outlook.MailItem

Set appOutlook = New Outlook.Application
Set objNameSpace = appOutlook.GetNamespace(MAPI")

'Create new mail item
Set objMailItem = appOutlook.CreateItem(olMailItem)

'set properties of mail item
With objMailItem
.To = strRecipient
.Recipients.ResolveAll
.subject = strSubject
.Body = strBody
.Display
End With

Set objMailItem = Nothing
Set objNameSpace = Nothing
Set appOutlook = Nothing

OBP
06-11-2008, 03:24 PM
http://vbaexpress.com/forum/showthread.php?t=15524

wasim_sono
06-17-2008, 03:17 AM
Dear All

Thanks a lot for ur sincere help. It is very useful to me and helped me to create a dynamic form. Now please please also help me to create user and permissions and secured mdb. I tried to create some user and set their permissions but they are no authenticated by mdb at start. Only Admin user start the mdb.

i want to create 5 users which can only search the contents of records thru a serach form which based on a query. 3 users just for data entry and make amendments thru a form.

Whats the function of read design?

Thanks in advance.

Wasim

OBP
06-17-2008, 07:23 AM
Wasim, did you use the Security Wizard to "Secure" the database?

wasim_sono
06-18-2008, 04:20 AM
Yes I used it and its very confusing. It again ask for security checks for forms, queries, tables etc. also again ask for different groups? It confused me.
I created users and set their permissions in security option. but please tell me about procedure of security wizard.

Thanks.

Wasim

OBP
06-18-2008, 08:36 AM
Wasim, once the Wizard has created the "Secure" database you use the "Desktop Shortcut" to open the Database, which should ask you to Login with Username and Password.
If you are the "Administrator" and "Owner" of the Database you can use the Main Menu>Tools>Securty to set up the "User's" or "User Group's" Accounts.
To do what you want you need to set up User Group Accounts by adding new Groups "Data Entry" and "Search".
You then use the "User and User Group Permissions" to set up the Permissions for your 2 user Groups, where you set the permissions for what each group can do with each Table, Query, Form, Report and Macro in the database.
Those that can add/edit data have to have read/edit/add/delete rights to tables and Queries as well as Open right for Forms and Reports.
Searchers can only have Read and Open rights to Tables, Queries, Forms and Reports.

When you have the User Groups set up, you add the User's Accounts and add them to the appropriate Group.