Fixed the problem by adding the line "ORDER BY TG_Orders.Order_ID" to the strSQL portion of the OnClick property. This code now reads:
strSQL = "SELECT TG_Orders.Order_ID, TG_Orders.Order_Date, ... TG_Orders.Order_Source "
strSQL = strSQL + "FROM (TG_Customers INNER JOIN TG_Orders ON...
Here's the code for the button's OnClick:
Private Sub OrderForm_Click()
'creates an SQL statement to be used in a query def
'n Error GoTo ErrorHandler
Dim val As String
Dim db As Database
Dim rec As DAO.Recordset
Dim strSQL As String
Dim strDocumentName As String 'name of the template...
Hello everyone! I've had a mailmerge working perfectly for over a year, but just last week it started acting funny. It used to be that the letters/orders would print sequencially (1-20) but now they print in an odd sequence (could be something like 13-20, then 1-12. I've also seen it even...
Alright, figured it out. Instead of defining rs and rs1 as recordsets, I just defined them as Variants. The code now works great, but I've got a minor formatting question. I'm gonna start a new thread for that because it belongs in a different forum!
Thanks again,
Nate
Thanks a lot for the point in the right direction, however I'm now getting the runtime error '13' Type Mismatch error. Maybe it's just early, but I can't figure out why it's happening. When I debug, the highlighted line starts with Set rs = db.OpenRecordset. The key field is...
Hello everyone! I've been working on this database for quite some time now, and I've got a pretty in depth question that I haven't been able to answer.
Some background: The company I work for plants trees for funeral homes. A single funeral home can plant 10 trees for 10 different people...
Thank you both for responding to my problem. I tried both of your suggestions, but I couldn't get either of them to work for me, so I just went back to what I had and re-did everything. It now works, and Word hasn't crashed yet, but I still don't trust it.
I'm going to post my code now (I'm...
I'm using the information provided in this FAQ, adapted to fit my own database: faq705-3237.
I'm running it in Access 2002 (2002 file format) on a server running Windows 2000 Server. MS Word is also v.2002, and is crashing 9 out of 10 times before the merge displays a new document. After the...
Hello everybody,
I'm currently working on an Access database that requires its users to print multiple documents. Specifically, I need to be able to do the following things:
1. Have certain checked data sets print as Template A, others as Template B.
I have included a check box in the form to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.