A
arista via AccessMonster.com
Hi, can I define domain in DSum function in different way ? Generaly DSum
(expr, domain, [criteria]) where domain is name of query or table in quotes.
I am writing code in VBA and would like to use as a domain this code:
dim strSQL as String
Dim myData As New ADODB.Recordset
'here presented strSQL is only shortcut, the real strSQL string is much
longer
strSQL = "SELECT tblShiftData.Date FROM tblShiftData ORDER BY tblShiftData.
Date, tblShiftData.ShiftNo;"
myData.Open strSQL, CurrentProject.Connection, adOpenForwardOnly,
adLockReadOnly
I was trying to define domain in DSum function like:
Me!Text59.ControlSource = "=CSng(Nz(DSum(""[PayCount]"",""myData"",""
[SuppTypeID]=6""),0))"
or
Me!Text59.ControlSource = "=CSng(Nz(DSum(""[PayCount]"",""" & strSQL & ",""
[SuppTypeID]=6""),0))"
BUT UNCESSFULLY !
Is it possible somehow please ? Thanks
(expr, domain, [criteria]) where domain is name of query or table in quotes.
I am writing code in VBA and would like to use as a domain this code:
dim strSQL as String
Dim myData As New ADODB.Recordset
'here presented strSQL is only shortcut, the real strSQL string is much
longer
strSQL = "SELECT tblShiftData.Date FROM tblShiftData ORDER BY tblShiftData.
Date, tblShiftData.ShiftNo;"
myData.Open strSQL, CurrentProject.Connection, adOpenForwardOnly,
adLockReadOnly
I was trying to define domain in DSum function like:
Me!Text59.ControlSource = "=CSng(Nz(DSum(""[PayCount]"",""myData"",""
[SuppTypeID]=6""),0))"
or
Me!Text59.ControlSource = "=CSng(Nz(DSum(""[PayCount]"",""" & strSQL & ",""
[SuppTypeID]=6""),0))"
BUT UNCESSFULLY !
Is it possible somehow please ? Thanks