H
HENDRY_del_FUEGO via AccessMonster.com
Hi,
I have a table 'OverviewInconsistency' with the following columns PrimaryKey
(number), Code (text), Description (text) and SQLtext (text).
eg. 1 // 1__A0 // find the inactive items //
SELECT iif([Basic data checked + default data]![ActiveSwitch]= "YES", "ok",
"non") FROM [Basic data checked + default data];
I use the following function
Public Function GetSavedQuerySQL(Code As String) As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("OverviewInconsistency")
rst.Index = "PrimaryKey"
rst.Seek "=", Code
If Not rst.NoMatch Then
GetSavedQuerySQL = rst!SQLText
End If
rst.Close
Set rst = Nothing
Set db = Nothing
End Function
I used this function as GetSavedQuerySQL(1__A0)
i get the following error "runtime error 3421 data type conversion error"
if I debug it marks rst.Seek "=", Code
I cant find where I am screwing things up or maybe is my function wrong?
I have a table 'OverviewInconsistency' with the following columns PrimaryKey
(number), Code (text), Description (text) and SQLtext (text).
eg. 1 // 1__A0 // find the inactive items //
SELECT iif([Basic data checked + default data]![ActiveSwitch]= "YES", "ok",
"non") FROM [Basic data checked + default data];
I use the following function
Public Function GetSavedQuerySQL(Code As String) As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("OverviewInconsistency")
rst.Index = "PrimaryKey"
rst.Seek "=", Code
If Not rst.NoMatch Then
GetSavedQuerySQL = rst!SQLText
End If
rst.Close
Set rst = Nothing
Set db = Nothing
End Function
I used this function as GetSavedQuerySQL(1__A0)
i get the following error "runtime error 3421 data type conversion error"
if I debug it marks rst.Seek "=", Code
I cant find where I am screwing things up or maybe is my function wrong?