Thought I posted this once before, now can't find it -- so I apologize if it turns out to be a duplicate posting.
Anyway...Figured out how to design a table then extract the info I wanted via a query. Last thing I simply cannot figure out is how to get the query exported onto mailing labels.
Thank you in advance to anyone willing to share their time and expertise to assist me in this last step.
I have a multilingual database. currently I set a public code when a user logs on setting the language to be used on form Labels and report Labels. I use the on load event in forms and on Current event for reports to set the labels caption eg if gbllanguage = "English" them me.label1.caption = "English language" if gbllanguage = "Deutsch" them me.label1.caption = "Deutsche Sprache" etc
Now the database is rather big and more and more languages are to be added. It is quiete cumbersombe to update the VBA modules.
Does anyone have an idea how to set the label values in a table and when a form is opened the relevant labels will appear in the corresponding language/value.
Obviously I don't want it to slow down opening the forms etc as the program is rather big
Due to limited space in my Report Heading, I am trying to vertically label columns. I figured out in the Properties section of the label that I can turn on Vertical Label. However, when I view it on the report, the label, which is now vertical is turned to the left vs the right. How do I flip it? In addition, is there a way to rotate the text to a 45% angle.
I have a subfom that displays perfectly in datsheet view.
One of the columns changes its contents depending on a value. i.e. a list of units or a list of costs. I change the data using a Recordset update.
When in the Main Form I am trying to change the column label that appears in the SubForm header above the column, to either 'Units' or 'Cost, to match the data.
I am strugging to find the correct syntax, can anyone help?
ive got a form with a number of different fields and labels and a number of boxes which help keep like fields together visually.
The problem i have is that if i click on the box when viewing it the fields dissapear behind the box despite me setting the box to the back of the form.
Anyone know what is happening? is there anyway to lock the items in place?
Is it possible to change the format of the mailing labels once the report has been created? I have one that has 24 labels on it, but I need for it to have 30. Also I can't remember how I created it in the first place. What steps do I need to go through to make a new report?
I have created a report for labels using the Label Wizard, and found the code on the MS KB about skipping the labels that have already been used, and printing on the next one along.
Page on MS KB (http://support.microsoft.com/?kbid=299024)
When I try using this code in Access 2003 however, it seems to go into some sort of loop, and produces 100+ pages for the report when I try and skip 1 label for example. Can anyone help me get this working for 2003?
Here's my module code, same as on the site above:
'************************************************* ******** 'Declarations section of the module. '************************************************* ******** Option Compare Database Option Explicit Dim LabelBlanks& Dim LabelCopies& Dim BlankCount& DimCopyCount& '================================================= ======== ' The following function will cause an input box to ' display when the report is run that prompts the user ' for the number of used labels to skip and how many ' copies of each label should be printed. '================================================= ======== Function LabelSetup() LabelBlanks& = Val(InputBox$("Enter number of used labels to skip")) LabelCopies& = Val(InputBox$("Enter number of copies to print")) If LabelBlanks& < 0 Then LabelBlanks& = 0 If LabelCopies& < 1 Then LabelCopies& = 1 End Function '================================================= ======== ' The following function sets the variables to a zero '================================================= ======== Function LabelInitialize() BlankCount& = 0 CopyCount& = 0 End Function '================================================= ======== ' The following function is the main part of this code ' that allows the labels to print as the user desires. '================================================= ======== Function LabelLayout(R As Report) If BlankCount& < LabelBlanks& Then R.NextRecord = False R.PrintSection = False BlankCount& = BlankCount& + 1 Else If CopyCount& < (LabelCopies& - 1) Then R.NextRecord = False CopyCount& = CopyCount& + 1 Else CopyCount& = 0 End If End If End Function
I need to generate 1 email with 3 attachments from an Access Db. These attachments are canned reports that are generated each week with fresh data.
I've done several searches and found a lot of good information here. Based on what I've read, I decided to output the 3 reports to a folder in My Documents and then automate Outlook to send the message.
I've used the output function to create the 3 files. No Problem, works well.
Then I found this code for automating Outlook. (Pasted below) I can get it to work (following either step 7 or step 8 below) but only if I include the attachment path in the SendMessage command.
Assuming the full paths are: C:My DocumentsReport1.snp C:My DocumentsReport2.snp C:My DocumentsReport3.snp
how do I modify the code to automatically attach all 3 files?
Any ideas? As always, thanks for taking the time to help, BeckieO
Sub SendMessage(Optional AttachmentPath) Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment
' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application")
' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg ' Add the To recipient(s) to the message. Set objOutlookRecip = .Recipients.Add("Henny Penny") objOutlookRecip.Type = olTo
' Add the CC recipient(s) to the message. Set objOutlookRecip = .Recipients.Add("Lucky Ducky") objOutlookRecip.Type = olCC
' Set the Subject, Body, and Importance of the message. .Subject = "This is an Automation test with Microsoft Outlook" .Body = "Last test - I promise." & vbCrLf & vbCrLf .Importance = olImportanceHigh 'High importance
' Add attachments to the message. If Not IsMissing(AttachmentPath) Then Set objOutlookAttach = .Attachments.Add(AttachmentPath) End If
' Resolve each Recipient's name. For Each objOutlookRecip In .Recipients objOutlookRecip.Resolve If Not objOutlookRecip.Resolve Then objOutlookMsg.Display End If Next .Send
End With Set objOutlookMsg = Nothing Set objOutlook = Nothing End Sub
7. To test this procedure, type the following line in the Immediate window, and then press ENTER: SendMessage "C:My DocumentsCustomers.txt"
8. To send the message without specifying an attachment, omit the argument when calling the procedure, as follows:SendMessage
I have a database of customers for which I want to print address labels depending on what group I have entered them in. There are about 30 different groups that they could be a member of. I have entered them in to groups by using "yes/no" fields on the customer table to indicate who is a member of which set. My problem is that I know how to indentify which group is required using sql
eg select surname,address from table where GP
where GP is one of the possible groups. I cannot however see a way of selecting the group variable from a form and entering into a query, so that I can print the required label set.
Can anyone please advise me on this or point point me in the direction of an example. I tried using a combo box on form but could not get it to pass the parameter correctly. Many thanks in advance.
I have a database for clients and have set up a form and code to run a query for different types of clients and to send emails to the group.
Everything works fine until I try to send and then I get a Microsoft Outlook pop-up which states:
"A program is trying to automatically send e-mail on your behalf. Do you want to allow this? If this is unexpected, it may be a virus and you should choose "No."
This message stays for 5 seconds and then I can click on "YES" and it will send the email, and start all over for the next recipient.
I am assuming this is an Outlook Spam Blocker, but is there any way to stop it?
I have a very basic DB of customers names and addresses. What I want to do is find all the enquiries within the months of August, September and October, send all these enquiries to a new table so that I can use this new table for a mailshot. The date of the incoming enquiry is in a field on it own and written as dd/mm/2006. If there is an easy way to create a mailing list from the original table please let me know. Best Regards Keith:o
I am preparing mailing label for a political campaign. On my list of voters, many times two or more people are listed at a single address. By consolidating the labels (and postage) I am able to save a lot of money.
I have written a query to group these names into those with 1,2, or 3 or more/address. For labels I am able to print 2 names/label by using the FirstOfFirstname, FirstOfLastname, LastOfFirstName, LastOfLastName generated in my query. This works fine for 2 names per label.
My question concerns 3 names per label. Does anyone know how to include all 3 names? Suggestions have included using a label with "The {LastName} Family" etc. but many times there is more than one last name per residence. Other suggestions are to print individual labels for each individual and overlap the labels to show all the names but just one address. These does save postage of $.42/mailing, but seems wasteful of labels and looks a little crude besides.
What I think I need is a clever query or queries that will be the data source for the labels. I have room for up to 3 names/label. I have been thinking about printing 2 labels -- one with one name and address and another with the rest of the names but this brings up problems of getting everything on the right envelope.
I have attached a DB that I am trying to create for my small business. Every month we have renewals of the client’s yearly contracts. I have created a form called frmRenewells, on this form you need to select a month and a year (please choose October 2006) this then runs query qryRenewell. The query then opens form frmRenewellSheet with the results. This works fine, but I really need the following to happen:
Open form frmRenewells and enter month & year, on clicking the enter button it launches a word template I have created and automatically pulls all the fields required into the word document. I can then press print and it will print a document for each client in the query.
I am unable to go into word and just open the query as it has * or wildcards in it. Therefore word will not allow me to select the query.
Hi--I have a contact database, and would like to be able to have a command button on the form for each contact to print one individual mailing label for that particular contact, preferably in a user-specified row/column on a page of Avery 6245 labels. Am realizing that this is a major hassle in Access but would like to do it within Access (why is it so easy to print huge lists of labels but so hard to print just one??). Any help would be appreciated. I'm pretty good at writing queries and reports in Access but a rank newbie at the underlying SQL and VBA so need major handholding if that's involved (and I know it is ). Thanks.
I need to e-mail weekly reports to several parties, but both Word and Excel are not working for me because I am losing the original formatting. For the sake of consistency and readability I need to preserve the original report format, but I am totally stumped as to how to do this. Please, someone, help!
Hi all,I've been struggling with this for a few hours... I sure hope that the solution to my problem is complicated so I don't feel really dumb!I'm trying to design a database to eliminate the HOURS that my mom spends trying to format mailing labels in Word. She deals with about 50 clients at a time, and sometimes needs to print labels for just a selection of them, but not all. I'd like to design a form where she can select (using an option button or similar) the clients for whom she wants to print a label, and print them all at the same time (rather than printing one at a time, which I can handle on my own). Creating mailing labels will be the only function of the db so the info stored in it will be relatively simple.I have the Northwinds db installed, and I've found the sample Macro controlling the Where condition for the labels report. I understand how to make it work for a single selection from a combo box (ie: only print labels for customers from a specific country)I have my report set up so it shows a label for each client, pulling data directly from the main table. No troubles with formatting. **knocks on wood**My problems:1. I searched this site and found a link to the MS KB file that outlines how to print multiples of one label or skip used labels before starting to print (Q95806 - "How to Skip Used Mailing Labels and Print Duplicates"). I'd like to use this, but can't make it work.2. I can't figure out how to "link" the option button to the client name as it's listed in the form, and then tell the report to only print labels for the selected clients.I have very little coding experience but I can make some simple code work and am OK at customizing pre-written code to my own needs if it's well commented, so VB isn't entirely out as an option.I have a possible solution in mind that involves creating a query that makes a new table with only the selected clients, which is then used to make the labels report. I think I could make that work if I could just figure out how to select the clients in the first place.I apologize in advance if this has been taken care of elsewhere. I tried to find it, but had trouble coming up with the right search string!Thanks in advance,~ Mel ~p.s. I'm using Access 2000.
I have to prepare invoice statements to send to my clients. I have managed to generate the invoices as a report.
However, I want to add two types of mailing addresses to this invoice report: "From" mailing address (my company's mailing address) and a "To" mailing address (the recipient's mailing address).
I have created a Clients table which contains the company's mailing address details and a separate ClientContacts table which contains the primary contact name and the secondary contact name (along with their email addresses) for the respective company.
My problem is how to incorporate this information on the invoice report. What I have done is to create an unbounded text box on the invoice report and manually type in this information. Is there a way to add my company mailing address as a "From" mailing address and the recipient's mailing address as a "To" mailing address on the report automatically?
I have a table that contains a lot of different information regarding to mailing.
There are columns for Name, Address, Address2, Address 3, City, State, Zip, Country, Base Name, etc.
Some units will only required parts of the above information. I'm using the Name as an identifier in the DB only and Address is the beginning of content that I want to use.
My issue stems out of the fact that the City, State, and Country are not always required but the Base Name, may be used in lieu of the City.
I was looking at making checkboxes next to each of the columns on the form on the field and then using those checkboxes somehow to create a report for Mailing Labels.
Hi there, I have created a form containing contact details for a 100 or so different people/companies. I want to have a button that will allow me to print an address label for the current displayed record (e.g. when I find the company I wish to contact in my form I wish to click [Print Label] and then get this company's address printed on my label). Have some programming experience but not sure how to go about this in access?
Also as an aside question, is it possible for me to display a list in my form instead of individual records. What I mean is that I would have Name, Address, etc as titles accross the top and then would have a list of all records below these. Then I could click on a record to get more detail and also click on one of the titles to re-order the data by this field?......I know these are pretty big questions but a pointer to somewhere with this info or a sample app doing something similiar would be great. :)
I am trying to construct a query to extract mailing addresses from a table. I have individuals entered into a table (a separate record for each person) but if they are married I want an address such as Mr and Mrs J. Doe so that only one address label is printed off so that only one letter is sent out. If one of them dies then the address should only go to the surviving party eg Mrs J.
I'm a very new user of Access. I am creating a contacts database (3000+ contacts), with up to 6 addresses per contact, though most will only have around three. I'd like to find the best way to select the preferred mailing address (using a combo box??) in order to be able to regularly creating mailing labels (and letter mail merges).
Ok, I've run into two serious problems in testing, and another question that I'm hoping you guys can help me solve. Below my questions is the code used for making the search query/email program.
Problem #1: In testing, this search program only is working for me for new data. Any data that I had in the database prior to implimenting the program will not move past the search stage. In other words, I will do a search, it will find the emails and bring them up in a box, I hit "OK" and it gets hung up and won't move on to opening up a new Email with the addresses implemented. However if I enter new data in the database, say with a weird name so its only bringing up the new entry and no old entry, it works fine and opens up the new email.
Problem #2: Items I would like to search like check boxes. Say I have a check box "Donor", this is listed in the database as a 1 or 0. I can't have my boss searching 1 or 0. Is there a way to change this to, say, being recorded in the DB as a Yes or No. That way he would check to search "Donor" and type Yes in the search box and this would search the DB "Donor" column for "Yes" and bring up the results.
New Question: My boss and I reviewed the form as it is so far yesterday. He was asking if I could add a Print Labels option in there. I'm wondering instead of adding another seperate search box and all that mess for a labels search print, can I rather add two check boxes, one labeled "Print Labels" and the other labeled "Email". What this would do is depending on the check box you selected it would either run the search and email like we have it, or clicking the other check box would run the search and print labels.
Quote: 'Author: Michael Walts, but use it as you like'Important information! this code requires a reference to the Microsoft DAO object library Option Compare Database Option Explicit
Private Sub cmdEmail_Click()
'will hold the dynamic SQL query Dim strSQL As String
'will hold the WHERE clause portion of our SQL query Dim strWHERE As String
'will hold all the recipients of this message Dim strRecipients As String
'the recordset we will use to get the emails of the records that match our criteria Dim rst As DAO.Recordset
'if there is input in the search criteria, then we will run the query and send the e-mail If txtSearch <> "" Then
'if you have more buttons, just add mosr cases (the value of the radio button '= the Case number, so Value of the State radio button is 1, etc.) Select Case opgSearch.Value
Case 1 strWHERE = "WHERE State = '" & txtSearch & "'"
Case 2 strWHERE = "WHERE City = '" & txtSearch & "'" End Select
strSQL = "SELECT EMail FROM tblUser " & strWHERE
'run the query and get the results into the recordset Set rst = CurrentDb.OpenRecordset(strSQL)
'Loop through the recordset and add all the EMails Do While Not rst.EOF strRecipients = strRecipients & ";" & rst!EMail rst.MoveNext Loop
'remove the first ; from the strRecipients strRecipients = Right(strRecipients, Len(strRecipients) - 1)
'stops a ' entered in the field from breaking the query Private Function SQLSafe(safeMe As String) As String SQLSafe = Replace(safeMe, "'", "''") End Function
I am trying to create a mailing list of patients. Let's say I am creating a mailing list for February. I need the mailing list to consist of people who have had surgery in February from the beginning of the database, and people who have had surgery three months ago, so anyone who had surgery in November. I have created a form that has a button which is connected to a query, the form has a unbound textbox where I can enter the month in (2 for February). Then the query uses the datepart function to search for this month in their date of surgery. But this only gives me people for surgeries with february, how would I get people who have had surgery three months ago in the same query.