I did as you suggested and changed my SQL to
strSQL = "Select NZ([Lt_Cases], ""None Given""), Mandate_Type, Mandate_Date, Date_Mandate_Released, Addressee, Appellant, Appellee, CaseNo, Accident_Date, Addressee_Name, Recipients " & _
"From CMS.V_Macro4CoverLetter " & _
"Where...
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.
I am running this in Word, but pulling information from an Access db. Here is more code.
Private Sub btnGetData_Click()
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim lngConnectionState As Long
Dim strSQL As String
Dim CurDoc...
I have created a form using Word 2007 that queries an Access database. If the Access field, LT_Cases is null, I am trying to replace it with the text "None Given". Here is the code I have tried so far. I have used each block of commented code, separately, but to no avail. I get runtime...
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?
I have created a form using Word 2007 that queries an Access database. The problem is my SQL statement isn't working. For some reason, my entire SQL statement is being skipped and my error message is coming up. After I click ok for the error message I get my search is complete message...
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)
I am using Office 2007 and I have created a form that pulls information from an Access database. My problem is the code works fine for the first two records, but it gets jumbled up after that. Below is a copy of my code.
Public blnCancelled As Boolean
Public rstart As Object
Public rend As...
Hello everyone. I am using Microsoft Office 2007 and I have created a form that pulls information from an Access database and puts it in a table. I want to have 3 tables per page that are populated with information from the database. My dilemma is I can populate one table, but for some reason...
My initial SQL made sense b/c it was giving me information. I saw on another site where Nz (null value) was used, so I tried changing the SQL statement to the following:
strSQL = "Select Mandate_Type, Parm1, Agency_Description, CaseNo, Appellant, Appellee, Lt_Cases, Opinion_Date, Chief_Judge...
I have created a form using Word 2007 that queries an Access database. I want my users to be able to search the database by either entering the type of mandate or a specific date range. My dilemma is my SQL will not let them do one or the other.
For this SQL statement they have to enter...
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.