Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program won't recognize variable

Status
Not open for further replies.

sorensok

Programmer
Oct 29, 2002
36
US
I am writing some code to automatically print out a form. The problem I ran into is I have an if statement that reads:

If rsMyRS!TotalBalanceAmount > 0 Then
...

My problem is that the TotalBalanceAmount is what I named the textbox the holds the formula: =Sum(Rate)

My program refuses to recognize TotalBalanceAmount. I tried typing it like rsMyRS![=Sum(Rate)], but that doesn't work either. The program does recognize the variable Rate, though (as in rsMyRS!Rate). Any idea how to get it to recognize TotalBalanceAmount?

Thank you in advance,

Kyle
 
Hi!

Try Me!TotalBalanceAmount.

BTW, what error are you getting?

hth
Jeff Bridgham
bridgham@purdue.edu
 
I set up my code like this.

Set dbMyDB = CodeDb
Set rsMyRS = dbMyDB.OpenRecordset("Clients")

Me!TotalBalanceAmount won't work how I have it set up. Do you think I should set it up different?

The error is:
Item not found in this collection.

Thanks,
KYLE
 
I figured it out. Thanks for the help

KYLE
 
Kyle,

It's usually best to post what the solution is. Sometimes it's a bit embarassing (like if you've spelled something wrong), but it helps people who look at this thread later to learn.

jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top