I changed my strSQL to
strSQL = "Select Mandate_Type, Mandate_Date, Date_Mandate_Released, Addressee, Appellant, Appellee, CaseNo, NZ([Lt_Cases],"None Given"), Accident_Date, Addressee_Name, Recipients " & _
and now I get compile error: Expected end of statement and None is highlighted.
...Dim CurDoc As Document
Dim Addressee_Name As Variant
Dim Addressee As Variant
Dim LT_Cases As Variant
'*****Set up the connection to the database*****
conn.ConnectionString = "Provider=MSDAORA; Data Source=TSD1; User ID=omitted; Password=omitted"...
...each block of commented code, separately, but to no avail. I get runtime error 94: invalid use of Null. Any help will be greatly appreciated.
'*****Add formatting for table*****
.TypeText Text:="RE: "
.TypeText Text:=txtAppellant.Value
.MoveRight unit:=wdCell
.TypeText...
Does it matter that the strSQL works in another view where the date is stored as 5/2/2006 as opposed to being stored as 02/01/2007 in the veiw I am having the problem with?
...Dim rs As New ADODB.Recordset
Dim lngConnectionState As Long
Dim strSQL As String
Dim ntable As Table
'*****Set up the connection to the database*****
conn.ConnectionString = "Provider=MSDAORA; Data Source=TSD1; User ID=omitted for security...
Thanks Gerry! I am now getting runtime error 5834 Item with specified name does not exist.
The following line of code is highlighted:
.Range.Style = "MyTableText"
I thought it would be easier to use a table so that the information will line up. I am open to other suggestions. I have never used Styles so if that is easier and you could point me in the right direction I am definitely willing to try it.
No need to worry. I figured it out. I just had to add parenthesis.
Set ntable = ActiveDocument.Tables.Add(Range:=trange, NumRows:=8, NumColumns:=2, _
DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed)
...As String
Dim trange As Range
Dim ntable As Table
Dim rstart As Long
Dim rend As Long
'*****Set up the connection to the database*****
conn.ConnectionString = "Provider=MSDAORA; Data Source=TSD1; User
ID=Omitted for security...
...& " "
Opinion.txtCaseNumber = rs.Fields("CaseNo").Value & " "
Opinion.txtOpinionDate = rs.Fields("Opinion_Date").Value & " "
'*****Hide the form so the document can come up*****
Opinion.Hide
'****Insert table*****
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=8...
...& "', 'mm/dd/yyyy') and to_date('" & NZ(DCAMacro.txtEnd.Value, #12/31/9999#) & "', 'mm/dd/yyyy')" & _
"and Mandate_Type Like '" & NZ(DCAMacro.txtMandate_Type.Value, "*") & "'" & _
"Order by Appellant "
Now I get a compile error error that says Sub or Function not defined and Nz is highlighted.
...& DCAMacro.txtEnd.Value & "', 'mm/dd/yyyy')" & _
"or Mandate_Type = '" & DCAMacro.txtMandate_Type.Value
& "'" & _
"Order by Appellant "
'*****Open the recordset*****
rs.Open strSQL, conn, adOenKeyset, adLockOptimistic
'*****Get the data if not end of the record set*****
If rs.EOF...
Resolved. After some playing around I changed my SQL to
strSQL = "Select Mandate_Type, Parm1, Agency_Description, CaseNo, Appellant, Appellee, Lt_Cases, Opinion_Date, Chief_Judge, Mandate_Date " & _
"From CMS.V_Macro4mandate " & _
"Where Date_Mandate_Released =...
Thanks a lot. I have one other problem. I am trying to pull information from the database using the date that is entered on my form. Here is the SQL I am using:
strSQL = "Select Mandate_Type, Parm1, Agency_Description, CaseNo, Appellant, Appellee, Lt_Cases, Opinion_Date, Chief_Judge...
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.