J
John
I am trying to write a function which will load a "rules
array" from the current database the first time the
function is called in a query. The rules table is much
more complicated that it looks here. I tried to keep
simple for first trial.
The CAPS line (DIM MYDB AS DATABASE) give me an error:
user-defined type not defined
I am sure I am missing something simple. Any help
appreciated.
Code snipet follows-------
Global buildtypearray As Boolean
Global typearray(20) As Integer
Public Function CalcDue(AdvanceType As Integer, Advance As
Double, FundDate As Variant, SettleDate As Variant,
PaidDate As Variant) As Double
If buildtypearray Then
Else
DIM MYDB AS DATABASE,
Dim mydataset As Recordset, myqry As String
Set myqry = "select fundingtype, maxmultiple from
dbo_fundingtype_parms;"
Set mydb = CurrentDb
Set mydataset = mydb.openrecordset(myqry)
Do Until rst.EOF
i = mydataset(fundingtype)
typearray(i)= mydataset(maxmultiple)
mydataset.MoveNext
Loop
End If
buildtypearray = True
'etc
End Function
array" from the current database the first time the
function is called in a query. The rules table is much
more complicated that it looks here. I tried to keep
simple for first trial.
The CAPS line (DIM MYDB AS DATABASE) give me an error:
user-defined type not defined
I am sure I am missing something simple. Any help
appreciated.
Code snipet follows-------
Global buildtypearray As Boolean
Global typearray(20) As Integer
Public Function CalcDue(AdvanceType As Integer, Advance As
Double, FundDate As Variant, SettleDate As Variant,
PaidDate As Variant) As Double
If buildtypearray Then
Else
DIM MYDB AS DATABASE,
Dim mydataset As Recordset, myqry As String
Set myqry = "select fundingtype, maxmultiple from
dbo_fundingtype_parms;"
Set mydb = CurrentDb
Set mydataset = mydb.openrecordset(myqry)
Do Until rst.EOF
i = mydataset(fundingtype)
typearray(i)= mydataset(maxmultiple)
mydataset.MoveNext
Loop
End If
buildtypearray = True
'etc
End Function