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!

Run query and update a label with results (loop)

Status
Not open for further replies.

jeffshex

Technical User
Jun 30, 2005
208
US
I have a main form where a user clicks on their name to access their files, it then goes to their main page.
I am trying to run a query which I have saved and update a label with the results. (Kind of like a reminder.)
The problem is, I'm not 100% sure how to go about that.
I need to call the query, pass the value of the user who clicked, and then loop through the query results and have them post to a lblUpdate.

Any pointers on how to get started?
Thanks!!!
 
You can use the ADO or DAO, Execute command.

When you say, "loop Thru Recordset", why?
To aggregate a field? ...easier way
To supply several values? ...tricky?

Maybe all you need is an Domain aggregate function?

lblUpdate.Caption = DSum("txtAmount","tblSales" _
"txtUser =""" & Me.txtUser & """")
 
Hmm.

I suppose all I'm trying to do is just display a query through a label. That sounds a little weird.
But that's the over all look I'm going for.
I don't want to display a query window or anything like that. I was just wanting it to look integrated with the form.

I'm probably making this harder than I should.

-Jeff
 
impossible, may be the word?

A labal Caption is limited with the amount of characters,
it can hold.
You can EASILY, simulate the appearance of a label,
using a subform, or a listbox.
Just make the Background color = Transparent.
And the border colour transparent.

same with all the fields(subform)
???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top