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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I know I'm missing something

Status
Not open for further replies.

kjjj

Technical User
Apr 23, 2005
19
US
I'm having a tough time getting through this... any one?

I have a chart on a form where each time I open the form, the chart is based on a different table. I am looking to change the Y axis range based on the following. The query
won't run even though the message bar has the correct name of the table?

method open(var eventInfo Event)
var
tc TCursor
stTableName String
mm string
qu1 query
endVar

mm = active.tableName
stTableName = ("'" + mm + "'")

message(stTableName)
sleep(3000)

tc.open(stTableName)

qu1 = query

stTableName | ddrun |
| _join1, Calc min |
| _join1, calc max |

endQuery

qu1.executeQBE("t2mp.db")
 
You may have missed it off your code but you need to put ~stTableName when using it in a query. You seem to be missing the ~.

Woody
 
Thanks Woody for Your reply,
If I put a tilde in the "tc.open" I receive an identifyer error, so if I leave that out and just place it in the query the syntax appears ok however, when I run it I get I get an "Error trying to get property named TableName of the object... Property not valid"
I thought that I was getting the string equivelent of the TableName and not the property value? if that makes any sence?
kim
kjjj
Thanks again woody
I gotta love this to keep at it, so i'll just keep keeping on :)
 
Based on what you showed, you don't need or want to open that tcursor. An extra step with no advantage based on what you showed. (You may want/need to open it, but you can do that after the query has run.)

stTablename=active.tablename

qu1 = query

~stTableName | ddrun |
| _join1, Calc min |
| _join1, calc max |

endQuery



How about (do you get the same table/structure without the _join?):

qu1 = query

~stTableName | ddrun |
| Calc min, calc max |

endQuery


Tony McGuire
"It's not about having enough time. It's about priorities.
 
Hey Tony Thanks,
I haven't tried it yet but will in minutes. It always amazes me how I can teach my self the wrong way to do things... I did not know that I didn't need the tcursor for a query, thought it was needed for ? lack of better word "Focus" I am learning.. with others help
Thanks
kim
kjjj
 
Tony and Woody,
Thanks for all your help I finally got it. I was placeing this in a push button to test... the error message alerted me that the property was not valid for this object #button39. Yes it took a while to figure it but I got it
Works Great When you place it in the "open" rather than a push button. I am sure You help, just for the laughs off of us young to the dance. Thanks for all that You do
kim
kjjj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top