Hi,
I'm having a problem I'm sure is obvious but I can't work it out.
I want to be able to push a button on a form, which will run a query and put the result (1 variable) into a text box on the same form. I've linked the button to a 'setValue' statement which I thought would pick up the named query, get the result, and put it into the text box but no joy.
The two lines of code I'm using within the setValue statement (via a macro) are
Item: [Forms]![frm1]![queriedText]
Expression: [qry1]![LastOfprojectCode]
Where frm1 is the name of my form, queriedText is the name of the box I want to put it in, and qry1 is the name of the query, and LastOfprojectCode is the name of the variable returned by the query.
My error message is:
"The object doesn't contain the automation object 'qry1.'"
...And a bit more decriptive text I can post if anyone needs it - I don't think it's anything useful
Am I doing the wrong thing using setValue? Is it easier to do via VB (which I have limited experience with).
Cheers in advance,
Jon
I'm having a problem I'm sure is obvious but I can't work it out.
I want to be able to push a button on a form, which will run a query and put the result (1 variable) into a text box on the same form. I've linked the button to a 'setValue' statement which I thought would pick up the named query, get the result, and put it into the text box but no joy.
The two lines of code I'm using within the setValue statement (via a macro) are
Item: [Forms]![frm1]![queriedText]
Expression: [qry1]![LastOfprojectCode]
Where frm1 is the name of my form, queriedText is the name of the box I want to put it in, and qry1 is the name of the query, and LastOfprojectCode is the name of the variable returned by the query.
My error message is:
"The object doesn't contain the automation object 'qry1.'"
...And a bit more decriptive text I can post if anyone needs it - I don't think it's anything useful
Am I doing the wrong thing using setValue? Is it easier to do via VB (which I have limited experience with).
Cheers in advance,
Jon