This function works
now I want to query the function from Access SQL and return all of the data in the recordset. Can this be done?
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
Code:
Function rwaInfo(MyParam As String)
Dim MyDb As Database, MyQry As QueryDef, MyRS As DAO.Recordset
Set MyDb = CurrentDb()
Set MyQry = MyDb.CreateQueryDef("")
MyQry.Connect = "ODBC;DSN=abc;DBQ=def;UID=xxxxx;PWD=xxxxx"
MyQry.SQL = "SELECT * FROM VAT WHERE RWA_NO = '" & MyParam & "'"
MyQry.ReturnsRecords = True
Set MyRS = MyQry.OpenRecordset()
MyRS.MoveFirst
'Debug.Print MyRS!rwa_no
MyQry.Close
MyRS.Close
MyDb.Close
End Function
now I want to query the function from Access SQL and return all of the data in the recordset. Can this be done?
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
