OK.. Here's my situation. Ive got a for with the following fields and example data:
Autonumber (Hidden)
Name: BG
Date: 12-20-06
Machine: 4APC
Operation: 2
Tool: MAS20750
Time Changed: 22:45
On a daily basis I need to enter values in here. I'll go through about 15-20 records where the first 4 fields are all the same (Name, Date, Machine, and Operation). Ideally, instead of having to type all this crap in every time, I'd like to have my new record automaticall fill in the value for these as whatever the last ones I put in were.
What I have done is created a select query that returns the last record entered according to the Autonumber, by setting the TopValue to 1. I saved this as QLastRecord
Then I created a Macro. One line, with the SetValue action.
I set my Item to this: [Forms]![Tool Changes]![Name].[DefaultValue]
I set my Expr to this: [QLastRecord]![Name]
(I pulled both of these from the expression builder, so I know its not a mistype in the expression)
When I run the macro, I get this:
Microsoft Access can't find the name 'QLastRecord" you entered in the expression.
It seems as though the macro is trying to find a form under the name QLastRecord, so I tried putting [Queries]! in front of this, to direct it to the query object, but i end up with basically the same thing.
Is it not possible for a macro to pull a value for SetValue from a query?
Please advise, and thanks