R
riri
Sub Macro1()
'
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\Documents and Settings\ekyriazidou\My Documents\My Data
Sources\sldnor01.odc" _
, ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=True;Initial Catalog=orca;Data Source=sldnor01;Use Procedure for
Prepare=1;Auto Translate=True;Packet Size=4096;Workstation
ID=7YNDT2JXP;Use Encryption for Data=False;Tag with column colla" _
, SQLStatement:="SELECT * FROM
""Tbl_ContractPlacementDetails""", _
SQLStatement1:="", SubType:=wdMergeSubTypeOther
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:=
_
"Client_ContactName"
ActiveDocument.MailMerge.ViewMailMergeFieldCodes = wdToggle
End Sub
Hello does anyone have a clue how to put a where condition inside that
VB code in the select statement that will equal a field from the
table to a textbox.value from a prompt ?
Thanks in advance
Riri
'
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\Documents and Settings\ekyriazidou\My Documents\My Data
Sources\sldnor01.odc" _
, ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=True;Initial Catalog=orca;Data Source=sldnor01;Use Procedure for
Prepare=1;Auto Translate=True;Packet Size=4096;Workstation
ID=7YNDT2JXP;Use Encryption for Data=False;Tag with column colla" _
, SQLStatement:="SELECT * FROM
""Tbl_ContractPlacementDetails""", _
SQLStatement1:="", SubType:=wdMergeSubTypeOther
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:=
_
"Client_ContactName"
ActiveDocument.MailMerge.ViewMailMergeFieldCodes = wdToggle
End Sub
Hello does anyone have a clue how to put a where condition inside that
VB code in the select statement that will equal a field from the
table to a textbox.value from a prompt ?
Thanks in advance
Riri