Well, I finally got it working with this code below. This is the same code as above that would only output one record but when I removed this code "ObjWord.MailMerge.DataSource.ActiveRecord = wdFirstRecord", it cycled through them all perfectly!! Thanks!!
If strList = "Test Merge" Then...
Okay, I got this far and it splits out the files like I need but it is stuck in a continual loop. Where am I going wrong?
ElseIf strList = "Test Merge" Then
Set ObjWordApp = CreateObject("Word.Application")
Set ObjWord = ObjWordApp.Documents.Open("C\TestDocument.docx")...
I don't believe I can modify the opendatasource to equal one name because I could have up to 100 employees in that table to process to letters.
The names change with every run.
yes, I am trying to output everything in the tblSeveranceLetters to a mailmerge that saves each by a Word and PDF with the employee's name as the filename.
It works perfect only, it bundles them.
I tried this and it only outputs one employee per file but it will only run the first record in the table.
If strList = "Test Letter" Then
Set ObjWordApp = CreateObject("Word.Application")
Set ObjWord = ObjWordApp.Documents.Open("C:\TestLetter.docx")...
When it stops for the message below, it shows 2 records to be processed, however, it seems to be looping through through both records at once and processing them in one file. It does create 2 Word and 2 PDF, but both employees are in each file.
If MsgBox(LastRecord & " employee severance...
This code works very well and does split the files into word and pdf from my access table, however, it groups them into one file.
For example, if I have two names in my table:
John Doe
Jane Doe
It will create a PDF/Word named John Doe and Jane Doe, however, John and Jane are in the same file...
I have this saving each record in tblSeveranceLetters to a word doc using Last Name but it only runs once. I get an error message that the database has been placed in a state by user Admin that prevents it from being opened or locked. Any ideas what I am doing wrong?
Private Sub...
I have a code that is working where I can select multiple employees from a list box to create a table and then mail merge the data to a word document.
Here is my current code:
Dim currentDbName As String
Dim strList As String
Dim ObjWord As Word.Document
DoCmd.SetWarnings False
strList =...
The script below works for a small SharePoint list but I cannot seem to get it to work with a large list over 900,000 rows.
Any suggestions would be greatly appreciated. I am very new to PowerShell but I think I am missing the loop.
$SiteName = "https://folio.com/mysite"
$list = "Audit Only...
This is the code to call on the 64 bit procedure:
Public Sub ImportSeveranceData()
Dim strCurrProjPath As String
Dim objExcel As Object 'Excel.Application
Dim objWorkbook As Object 'Excel.Workbook
Dim objWorksheet As Object 'Worksheet
Dim strXlFileName As String 'Excel Workbook name
Dim...
Option Explicit
Private Declare PtrSafe Function ts_apiGetOpenFileName Lib "comdlg32.dll" _
Alias "GetOpenFileNameA" (tsFN As tsFileName) As Boolean
Private Declare PtrSafe Function ts_apiGetSaveFileName Lib "comdlg32.dll" _
Alias "GetSaveFileNameA" (tsFN As tsFileName) As Boolean
Private...
Hello, since my pc was upgraded, this code will not run. It goes directly to the "File selection was canceled." It worked fine before the upgrade but I had to put PtrSafe declarations in the following to get it it even open. Any help would be greatly appreciated on ideas to fix???
Okay, maybe I entered it wrong but your code is working now. It could be my declaration of "VarItem" that did it but not sure.
Anyway, I am very happy that it works!!
strSQL = "UPDATE tblSeveranceData " _
& " SET [Date Sent Payout] = Date() " _
& " WHERE [AutoNumber] = " &...
Here was what I was getting with just the AutoNumber as the criteria. The AutoNumber was reading blank. I totally agree with you that it should be pulling because it is a primary key:
UPDATE tblSeveranceData SET [Date Sent Payout]=Date() WHERE [EID]='2248808' And [AutoNumber] =
Here is...
Okay, this seems to be working: I simply used both the Employee ID and Autonumber for the criteria to find the record in the table.
strSQL = "UPDATE tblSeveranceData SET [Date Sent Payout]=Date() " & _
"WHERE [EID]='" & Me.EEList.Column(0, varItem) & "' And [Autonumber] =" &...
Umm, this updated all records for the employees. Wonder why it is not recognizing the autonumber?
When I pull the following, column 19 is equal to the autonumber in tblSeveranceData.
'Grab items selected in Listbox
iCount = 0
If Me!EEList.ItemsSelected.Count <> 0 Then...
Correct, [Term Date]= Date
Since the employee may have duplicate records, I am thinking I could use the AutoNumber as a unique identifier to update the tblEmployeeData![Date Pay Out] rather than use two criteria to find the unique record.
I tried this:
MyDB.Execute ("UPDATE tblSeveranceData...
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.