matthewnsarah07
Registered User.
- Local time
- Today, 05:20
- Joined
- Feb 19, 2008
- Messages
- 192
I have a staff holiday request form in use. Each time they have to fill in their name [Staff Name], Line Manager [Team Manager and their Id no. [Staff Number]
They select their name from a combobox but I then want them to click a button 'AutoFill' which sets the value of the Staff ID and Manager.
All the necessary info is in one table called tblStaffinfo
I set up a query which bases it self on the contents of the Staff Name combo
I then set a macro which opened the query, and then did a SetValue
Item as: [Forms]![Annual Leave Form].[Staff Number]
Expression as: [Queries]![qryPrefill].[Staff Number]
When I run the macro on the form after updating the staff name the query appears correct but then halts with the error
'The object doesn't contain the automation object Queries'
How do I get round this? Can you use queries in expressions
They select their name from a combobox but I then want them to click a button 'AutoFill' which sets the value of the Staff ID and Manager.
All the necessary info is in one table called tblStaffinfo
I set up a query which bases it self on the contents of the Staff Name combo
I then set a macro which opened the query, and then did a SetValue
Item as: [Forms]![Annual Leave Form].[Staff Number]
Expression as: [Queries]![qryPrefill].[Staff Number]
When I run the macro on the form after updating the staff name the query appears correct but then halts with the error
'The object doesn't contain the automation object Queries'
How do I get round this? Can you use queries in expressions