DLookUp

  • Thread starter graeme34 via AccessMonster.com
  • 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.
...
 
M

Marshall Barton

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)
 
T

Tom Lake

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
 
G

graeme34 via AccessMonster.com

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top