DLookUp

  • Thread starter Thread starter graeme34 via AccessMonster.com
  • Start date Start date
G

graeme34 via AccessMonster.com

I am trying to use the following on a report footer text box...

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)

Me.txtOutstanding = DLookup("[CurrentBalance]", "tblAccount", "
[AccountIndex]" _
= Me.AccountIndex)

End Sub

But the text box is staying blank....I guess its my syntax....any help please.
...
 
graeme34 said:
I am trying to use the following on a report footer text box...

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)

Me.txtOutstanding = DLookup("[CurrentBalance]", "tblAccount", "
[AccountIndex]" _
= Me.AccountIndex)

End Sub

But the text box is staying blank....I guess its my syntax....any help please.


Me.txtOutstanding = DLookup("[CurrentBalance]", _
"tblAccount", "AccountIndex=" & Me.AccountIndex)
 
graeme34 via AccessMonster.com said:
I am trying to use the following on a report footer text box...

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)

Me.txtOutstanding = DLookup("[CurrentBalance]", "tblAccount", "
[AccountIndex]" _
= Me.AccountIndex)

End Sub

But the text box is staying blank....I guess its my syntax....any help
please.

If AccountIndex is a text field, you have to do this:

Me.txtOutstanding = DLookup("[CurrentBalance]", "tblAccount",
"[AccountIndex]= '" & [AccountIndex] & "'")

Tom Lake
 
Thanks Marshall (again :) ) ...and Tom

Marshall said:
I am trying to use the following on a report footer text box...
[quoted text clipped - 7 lines]
But the text box is staying blank....I guess its my syntax....any help please.

Me.txtOutstanding = DLookup("[CurrentBalance]", _
"tblAccount", "AccountIndex=" & Me.AccountIndex)
 
Back
Top