Question Access 2010 Control Wizard

Okay, so got part one done and then Compile caught me on...

Public Sub AddAddress(target As Word.Selection, rs As DAO.Recordset, myID As String)

What are you trying to do there? A Mail Merge or just create labels or...?
 
Okay, so got part one done and then Compile caught me on...

Public Sub AddAddress(target As Word.Selection, rs As DAO.Recordset, myID As String)

What are you trying to do there? A Mail Merge or just create labels or...?

Its a Letterhead. This code was lifted from a Wrox book.

Thanks
Ted
 
Okay, what book? It's not something I have ever seen so before I mess with it I want to understand it better.
 
Okay, what book? It's not something I have ever seen so before I mess with it I want to understand it better.

The book is Access 2007 Programming, published by Wrox.

If you go to Clients form, there is a letter button, press this and bingo, one pre-prepared letter.

T
 
Okay what section because the code in that book is behind forms not in modules and is used a little different, unless I'm in the wrong Chapter (Chapter 16). I see the form and the button I just don't get how you adapted this code.
 
Its Chapter 10 in my copy - the section from p 412 titled "WORD - Creating a Formatted Letter with Data". It goes on for about 9 pages and my code is lifted from parts of it.

The code works fine with Early Binding and I have it in lots of my apps. Have you tried it?
T
 
Hmmm, let me look at that Chapter... Yes I tried it before I started changing it to Late Binding and then I went to change it and it keeps erroring out. Well, the first thing I noticed is that it's in a Module but tagged as a *Private Sub* which means it was meant for a form and not a Module but even after changing that it still not cooporating. That is why I want to see what it was orginally to see what I am doing wrong (or have to change) to get it to work in the Module.

Hope I explained that clearly enough!
 
Hmmm, let me look at that Chapter... Yes I tried it before I started changing it to Late Binding and then I went to change it and it keeps erroring out. Well, the first thing I noticed is that it's in a Module but tagged as a *Private Sub* which means it was meant for a form and not a Module but even after changing that it still not cooporating. That is why I want to see what it was orginally to see what I am doing wrong (or have to change) to get it to work in the Module.

Hope I explained that clearly enough!


Sure: good point that with the Private Sub. My error but it doesn't seem to make any difference - (are you surprised it compiled?). That's about 10 databases I have to change now. Thank you for pointing out this technical error. (copy and paste is a wonderful thing!)

No rush as the good news is that 2007 is running fine. Hope to hear from you soon. T
 
Grandkids here this weekend so hard to get to computer when they are here...

No not surprised it compiled bu surprised it actually ran outside the Module. I was under the impression that *Private* meant it belonged to that Module/Form only. I will look into that another day, right now is to finish changing the code... Well, once my little darlings go home!
 

Users who are viewing this thread

Back
Top Bottom