View Single Post
  #1 (permalink)  
Old March 30th, 2006, 05:01 PM
sugar sugar is offline
Authorized User
 
Join Date: Mar 2006
Location: Calexico, CA, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default OTHER: Pass query result to a Form

Hi, i make a code fully based on this this topic: http://p2p.wrox.com/topic.asp?TOPIC_ID=31077 It call and execute a .bat file, afther that it should run an sql query, pass the result as a variable and print it in the MsgBox myY, but it doesnt do it... what im missing?

Code:
Private Sub CmdRMSfile_Click()

Dim strCmd As String
Dim ds As Database
Dim dds As Recordset
Dim myY
Dim k As DAO.QueryDef

strCmd = """C:\xml2odbc\po.bat"""
Shell strCmd

Set ds = OpenDatabase("C:\OM-TEST\StoneEdge\SEOrdMan2002.mdb")
k = "select MAX(OrderNumber) from [Orders];"
Set dds = ds.OpenRecordset(k)
myY = dds!kk
MsgBox myY
ds.Close

End Sub
thanks in advance
Reply With Quote