View Full Version : problems with mail merge and combo boxes


discman9
10-16-2003, 02:27 AM
I’ve created a form based on a query of two tables. The form contains information of names and address. The form also contains two combo boxes where the user can select the area and the region of an address by looking up the info in the areaID or regionID field in the table. If the info is not in the list, the user is invited to input it by double clicking the field, which opens a form whereby the user can input the info. The problem is that when a mail merge is performed the merge picks up the ID number rather than the text information of the area i.e. instead of picking up Selby it will pick up 23. I'm using vb to run the merge. I’ve searched the forum and found lots of info mail merge one with combo boxes but there are not using vb. Can anyone help?

namliam
10-16-2003, 03:02 AM
Try using

Me.YourComboBox.column(1)

Column(0) is the first column (your number), probably bound but invisible (column width 0) Column(1) would be the second column (thi info your looking for)

P.S. Welcom to the site....

Regards

The Mailman

discman9
10-24-2003, 12:03 PM
Thanks for your reply mailman. i,ve tried your recomendation but still having problems. i;ve put the code in the property sheet of the query but that hasnt worked and i've tried it directly beneth the code that i'm using. I'd appreciate anymore help that you have. this is the code im using.

Thanks!
.ActiveDocument.Bookmarks("title").select
.Selection.Text = (CStr(Forms!frmwatinglist!Title))
.ActiveDocument.Bookmarks("firstname").select
.Selection.Text = (CStr(Forms!frmwatinglist!FirstName))
.ActiveDocument.Bookmarks("surname").select
.Selection.Text = (CStr(Forms!frmwatinglist!Surname))
.ActiveDocument.Bookmarks("number").select
.Selection.Text = (CStr(Forms!frmwatinglist!Number))
.ActiveDocument.Bookmarks("Address").select
.Selection.Text = (CStr(Forms!frmwatinglist!Address))
.ActiveDocument.Bookmarks("area").select
.Selection.Text = (CStr(Forms!frmwatinglist!AreaID))
.ActiveDocument.Bookmarks("Cityid").select
.Selection.Text = (CStr(Forms!frmwatinglist!CityID))

namliam
10-27-2003, 06:10 AM
your doing something in word? But i dont see no colomn nowhere...

Maybe if you post the form with empty table AND worddoc then i can have a look at it for ya...

Regards

discman9
11-04-2003, 12:28 PM
Sorry for the late response as I have been on annual leave with the kids. Thanks for taking the time to look at this for me, its being causing me grief. The form 'frmwatinglist' has a command button to automatically insert the details from the database into the word document but puts the ID code in the address fields instead of the text. I am obviously doing something wrong but don’t know what. Your help will be gratefully appreciated.

Thanks!

Discman9

discman9
11-04-2003, 12:31 PM
Hello Mailman, sorry for the late response as I have been on annual leave with the kids. Thanks for taking the time to look at this for me, its being causing me grief. The form 'frmwatinglist' has a command button to automatically insert the details from the database into the word document but puts the ID code in the address fields instead of the text. I am obviously doing something wrong but don’t know what. Your help will be gratefully appreciated.

I’ve tried to post this a couple of time apologies if I’ve duplicated it.

Thanks!

Discman9