Search results

  1. T

    ADODB Named Pipes not connecting

    Hi, I'm trying to create a connection to my SQL back end from my Access front end using ADODB, and I've been unsuccessful so far. I'm running SQL Express 2014 on Windows Server 2012, to Access 2013 on Windows 7, Here is my code: Private Function TestADODB() Dim rs As ADODB.Recordset Dim...
  2. T

    Order By produces duplicates

    Nevermind, I solved it. Since I'm reducing the recordset to only those that have the correct [Employee ID] anyway, I don't need the For..Next. Originally I was going to run this on the whole table, but I'm going to pass the [Employee ID] to this function for each employee.. Somehow lol Once I...
  3. T

    Order By produces duplicates

    I need to be able to assign a title to a set of dependents that is not what they are normally called. As in, every dependent is either called "Dependent" or "Step Child", but I need to call them "Child1" "Child2" "Child3" etc, for however many children an employee has. I have a function that...
  4. T

    Pinned Database won't open

    We're all using the same file. The database is located on a server share, but there's no back end database. It's something that I'd like to move to someday, but I haven't taken that on. I guess I'll just add that to the list of considerations when I decide to make that transition, but I haven't...
  5. T

    Pinned Database won't open

    It's really weird and I don't know what to do. I work in three different databases, but for one of them (the main company db), if I right clicked the pinned Access program on the taskbar and click the pinned database, it does nothing if someone else has the file open already. If the file isn't...
  6. T

    SQL Select found do THIS, N/F do THAT

    I like Dlookup - except when the record I want isn't the first record that matches. Dlookup's big fault is that it only returns the first record. And vbaInet's mention of Nz() for Nulls is a big blessing!
  7. T

    Union query for mail merge

    Oh you mean, why use a union query? I did it that way so that I would have a unique record for each employee and each dependent. Since the employees and dependents are on different tables, joined by the [Employee ID], when I do a query that just joins them, it puts the dependent NEXT to the...
  8. T

    Union query for mail merge

    The query is very simple, it pulls any employee or dependent that is 64 and older, along with the employee's employer and address.
  9. T

    Union query for mail merge

    Maybe I wasn't quite clear enough: when I just run the query itself, it opens, to show "Lisa Glow" and "Mike Glow". When I run the "Turning 64 Mail Merge" macro, it errors and I get nothing.
  10. T

    Union query for mail merge

    Yes, it opens when I click on it and has two records.
  11. T

    Union query for mail merge

    Here is the database, free of everything but what's relevant. The people are all made up. Currently the function is bound to the union query.
  12. T

    Union query for mail merge

    I tried that, and it still pops up with a "Select a Table" box. It has queries on the list, but no union queries, or queries that reference a union.
  13. T

    Union query for mail merge

    Yes, the first merge. It's not big at all: only 13 fields, which pulls only 2 records. I'm going to start today by trying the same query but only with the first Select statement (not a union query) and if that's successful, then maybe I'll just create two functions that are both run with one...
  14. T

    Union query for mail merge

    Oh, here's my symptom: I run the function from a macro and the three word docs appear, but a box pops up asking for the data source. I choose the union query, and a box from access says "Run-time error 5922: Word was unable to open the data source." When I debug the code, it breaks at...
  15. T

    Union query for mail merge

    This is my code: Function Turning64MailMerge() Dim oMainDoc As Word.Document Dim oEnvDoc As Word.Document Dim oChartDoc As Word.Document Dim oSel As Word.Selection Dim sDBPath As String Dim oApp As Object Set oApp = CreateObject("Word.Application") Set...
  16. T

    Union query for mail merge

    Does anyone know if it's possible to use a union query as a mail merge? I haven't found anything that says I can't do it, but I'm not getting my merge to complete, and when I switch to a plain query (and not changing anything else) my merge is successful, so I'm thinking there might be a...
  17. T

    Offer choice if .NoMatch = True

    Cronk, thanks for the suggestion, that cut my code way down, and looped correctly. Solo, it won't let me change the .MoveNext to .FindNext; it says that "Argument is not available". I have no idea why, but since I used Cronk's method of filtering the recordset before doing any loops, that should...
  18. T

    Offer choice if .NoMatch = True

    Thank you for the typo with the And's, you were right, I did need a space. Instead of putting a .FindNext inside the Do, I put the .FindFirst just outside of it, and it's looping correctly now! This is what I have now that works perfectly (I think!): Option Compare Database Option Explicit...
  19. T

    Offer choice if .NoMatch = True

    Okay, I got the syntax for the .FindFirst with multiple arguments, but that didn't solve anything. Here's where I'm confused. Do While rstZip.EOF = False rstZip.FindFirst "Zip = '" & stCurrentZip & "'" stCorrectCity = rstZip!City stCorrectState...
  20. T

    Offer choice if .NoMatch = True

    I just tried the .FindFirst, and I had actually tried that, but I need to find where the City, State, and Zip together are on the table, and it seems to me like I can search a FindFirst with only one argument? As in: rstZip.FindFirst "Zip = '" & stCurrentZip & "'" Works, but only searches...
Back
Top Bottom