Hi
I am trying to write a select query that prompts a user for an application number that will call a recordset from an already existing table that will be used to export XML file data that will later be transposed to another XML File. In my first sub procedure, I keep getting the runtime error message with the From statement. Would someone please help me. PS. any suggestions are for the code below is greatly appreciated. I am writing this code for use in Access 2003 and my OS is Windows XP.
Function TransformData()
Sub Find_Data_Set
Dim Number As String
Dim myprompt As String
Dim TBLGapApprovedC ostNew As ADODB.Recordset
Set TBLGapApprovedC ostNew = New ADODB.Recordset
Const myTitle = "Enter Application Number"
myprompt = "Please enter Project's Application Number"
Number = InputBox(myprom pt, myTitle)
With TBLGapApprovedC ostNew
.source = "SELECT TBLGapApprovedC osts.*" & _
"From TBLGapApprovedC osts" & _
"Where & TBLGapApprovedC osts.Applicatio n_Number= '" & Number & "'"
.ActiveConnecti on = CurrentProject. Connection
.CursorType = adOpenStatic
.LockType = adLockOptimisti c
.CursorLocation = adUseClient
.Open TBLGapApprovedC osts:=adCmdTabl e
End With
End Sub
Sub createXML()
'use the ExportXML method to create a source XML data file
Application.Exp ortXML ObjectType: acExportTable , _
DataSource:="TB LGapApprovedCos tNew", _
DataTarget:="C: \Database\Test\ XML Tranformation Files\NewCarryo ver.xml"
End Sub
Sub TransformXML()
'use the transformXML method to create a new XML data file
Application.Tra nsformXML DataSource:="C: \ Database\Test\X ML Tranformation Files\NewCarryo ver.xml", _
TransformSource :="C:\Database\ Test\XML Tranformation Files\Transform TBLGapApprovedC ost7.xsl", _
OutputTarget:=" C:\Database\Tes t\XML Tranformation Files\Carryover X.xml", _
WellFormedXMLOu tput:=False
End Sub
DoCmd.DeleteObj ect acTable, "TBLGapApproved CostNew"
MsgBox "Please load the CarryoverXML Tranformation File"
End Function
I am trying to write a select query that prompts a user for an application number that will call a recordset from an already existing table that will be used to export XML file data that will later be transposed to another XML File. In my first sub procedure, I keep getting the runtime error message with the From statement. Would someone please help me. PS. any suggestions are for the code below is greatly appreciated. I am writing this code for use in Access 2003 and my OS is Windows XP.
Function TransformData()
Sub Find_Data_Set
Dim Number As String
Dim myprompt As String
Dim TBLGapApprovedC ostNew As ADODB.Recordset
Set TBLGapApprovedC ostNew = New ADODB.Recordset
Const myTitle = "Enter Application Number"
myprompt = "Please enter Project's Application Number"
Number = InputBox(myprom pt, myTitle)
With TBLGapApprovedC ostNew
.source = "SELECT TBLGapApprovedC osts.*" & _
"From TBLGapApprovedC osts" & _
"Where & TBLGapApprovedC osts.Applicatio n_Number= '" & Number & "'"
.ActiveConnecti on = CurrentProject. Connection
.CursorType = adOpenStatic
.LockType = adLockOptimisti c
.CursorLocation = adUseClient
.Open TBLGapApprovedC osts:=adCmdTabl e
End With
End Sub
Sub createXML()
'use the ExportXML method to create a source XML data file
Application.Exp ortXML ObjectType: acExportTable , _
DataSource:="TB LGapApprovedCos tNew", _
DataTarget:="C: \Database\Test\ XML Tranformation Files\NewCarryo ver.xml"
End Sub
Sub TransformXML()
'use the transformXML method to create a new XML data file
Application.Tra nsformXML DataSource:="C: \ Database\Test\X ML Tranformation Files\NewCarryo ver.xml", _
TransformSource :="C:\Database\ Test\XML Tranformation Files\Transform TBLGapApprovedC ost7.xsl", _
OutputTarget:=" C:\Database\Tes t\XML Tranformation Files\Carryover X.xml", _
WellFormedXMLOu tput:=False
End Sub
DoCmd.DeleteObj ect acTable, "TBLGapApproved CostNew"
MsgBox "Please load the CarryoverXML Tranformation File"
End Function
Comment