Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emailing fill in the blank form

Status
Not open for further replies.

gbscobel

Technical User
Mar 11, 2004
68
US
I have an application I've created in Microsoft Access 2003 and I already use the sendobject command to email certain forms out of Access using Snapshot viewer which works great for the non-modifiable forms I've been sending. My customer now wants to email a form from Access with a few fields filled in at the top and then having some fill in the blank fields they want their customers to fill in and email back to them. I'm not seeing any format I can send the attachment that will show the form in it's original format but also allow the attachment to be opened and have it's boxes filled in manually. Does anybody have a suggestion for this that I could try?
 
If it's just a simple form, create an editable Data Access Page. Then have your IT department put it on the net. Then your customer can use the Internet to fill in the form anytime they want and the info will be saved to the table.

Forms are internal to Access. You can't "open" them outside of access.

Or put up a Citrix server( then you don't even need to use email. They login remotely and can use the form in the Access file.
 
Fneily,

Thanks for the response but unfortunately, those options won't really work for my customer. They really want to email something to them that they can fill in and send back from the email. There is not need for the data to end up back in the database, they just want to be able to send out an editable sheet in some format that they can then return to the customer's email.
 
With Outlook it is possible to send HTML. However, the user must click the boxes twice to fill them in.
Code:
Dim MyApp As New Outlook.Application
Dim MyItem As Outlook.MailItem

strBody = "<TABLE>" _
        & "<TR><TH>Telephone *</TH>" _
        & "<TD><INPUT NAME = 'Telephone' SIZE = 50></TD></TR>" _
        & "</TABLE>"

Set MyItem = MyApp.CreateItem(olMailItem)
With MyItem
   .To = "you @ yourcompany.com"
   .Subject = "Form"
   .HTMLBody = strBody
End With
MyItem.Display
 
Thank you for this, but I'm afraid I'm a bit confused by this. Where exactly would this code go? Is this in Access or outlook? I'm sorry but I'm not code expert and I just don't see what this code is supposed to do or where it should reside.
 
It is instead of SendObject. It would go in an Access Module. You will need a reference[red]*[/red] to the Microsoft Outlook x.x Object Library. The idea is that the code will create an email when it is run.
MyItem.Display
Means that it will show the email, rather than sending it.

--------------------------------------------
* In a module window, select Tools->References and scroll down until you see the reference you want, then tick the little box.
 
Ok, I think I have that now but can you explain a little bit about how you coded that? I have to add a whole bunch of fill in the blank fields on this email and I don't really understand your code. The other problem is that the email goes to the address and I see you can go in and enter data into the Telephone field but it doesn't appear to store it anywhere for sending back to the original sender. Is this not possible? When I reply to the email everything I enter is gone. Also, is there any way to add table/form data to this or graphic images?
 
It is HTML, you can add anything that HTML does. This includes images. The easiest way would probably be to do the HTML up in a suitable editor and then read it in.
When I was testing, I sent the email, chose reply, filled in the telephone number and re-sent. The email arrived with the telephone number.
 
Sorry, it's taken so long to get back on this. I'm still not getting the same results you are, I'm sure I must be doing something wrong. The email sends out and I see in the body the Telephone* with a fill in the blank box. If I fill that out, nothing happens when I send. If I don't fill it out and click Reply, I see Telephone* at in the body of the original message but the box is gone and I can't see how to enter information down there at this point. Can you shed some light on this? Also, I guess I'm going to need to find a programmer for this because I have no experience in HTML code at all so I wouldn't even know where to start to generate HTML code.
 
Would your people accept a word form emailed as an attachment? It might be the best option for you.
As for HTML, you can create forms in Word and other packages and save them as HTML, and there are lots of good tutorials on HTML, but there may be too much involved in getting the whole idea to work to make it worth while following this path.
It is possible to create forms in Outlook. Here is a discussion that I picked at random: Just as a point to consider, I went though a whole process of trying to find an easy way of getting a few small forms filled in by a group of people who ranged from the very able to those who were capable of any imaginable mistake. I ended up doing more or less what fneily suggested, that is, I put the whole lot on the web with a little ASP. In the end, it was the easiest and, I thought, safest method. Even if you do not wish to put your database on the web, creating online email forms is quite easy and you will find examples more or less everywhere.
 
Frankly, I'd be very happy to send a word document as an attachment since I would assume it would retain the formatting of the original Access report but I can't see anyway to do that. Send object doesn't provide that as one of the options. Is there something I'm missing? The information that's being sent back is simply some survey answers so user precision is not their biggest concern, they just want to make it as automated as possible via email. Please let me know what I need to do to send the report/form out as a Word attachment and I'll play with that option. I really do appreciate all the help.
 
I was not talking about a Word document created by SendObject, because it would not contain form fields that could be filled in. I meant a Word form, built using Word and attached using Outlook.
With mailmerge, the form could be related to each person. This:
'Native' mailmerge reports - as painless as possible
faq181-5088
is on FAQ on mailmerge, there are others.
The outlook code would look something like:
Code:
Sub OutlookX(str)
'Try that Orna:
Dim MyApp As New outlook.Application
Dim MyItem As outlook.MailItem

    Set MyItem = MyApp.CreateItem(olMailItem)
    With MyItem
       .To = strAddress
       .Attachments.Add "c:\Docs\Survey.doc"
       .Subject = "Survey"
       .ReadReceiptRequested = False
       .Body = strBody
       .Display
    End With
    MyItem = Nothing
    MyApp = Nothing

End Sub
I am afraid I am just throwing ideas at you, as I am not sure what is feasible and what will suit.
 
simply some survey answers". Do the answers have to typed in? If you can develop your survey to be questions with the answers in the form of - yes,no,maybe or often,sometimes,never or poor,fair,adequate,good,excellent or etc. - then you could send out an excel spreadsheet with the questions numbered and appropriate answers numbered, and when it's returned, use a pivot table to do the analysis, such as what percentage of question 2 answered fair. You can create a pivot table analysis on hundreds of answers in about 30 seconds.
Just a thought.
I would go with a word form, too.
 
Okay, thanks for the help. I've obviously done mail merges with Word before but I've never attempted to automate them. I'll check that FAQ and see how I can adapt it to my application. Thanks for your patience, I've been doing Access for a long time but have not a ton of experience with coding so it's always a struggle for me to interpret the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top