MikeJohnB said:
Try looking at
DoCmd.Close acQuery, queryname
I have not used this command except for closing forms. But acQuery is a
valid option but I am not sure of the queryname bit?
Let me know if I am barking up the right tree please?
Kindest Regards
Mike B
--
Advice to Posters.
Check your post for replies or request for more information.
Consider providing some feed back to the response you have recieved.
Kindest Regards Mike B
Mike, You're definitely helping me. I'm having trouble figuring out the
syntax I need, but this looks like the right place. My Object is
qryByLongSKU but so far Idon't have the right syntax. I tried DoCmd.Close
acQuery, qryByLongSKU
and got:
Run-time error '2493"
This action requires an Object Name argument
I'll keep working on it. Please let me know if you figure it out. Thanks.
The Close method carries out the Close action in Visual Basic.
Syntax
expression.Close(ObjectType, ObjectName, Save)
expression A variable that represents a DoCmd object.
Parameters
Name Required/Optional Data Type Description
ObjectType Optional AcObjectType A AcObjectType constant that represents the
type of object to close.
ObjectName Optional Variant A string expression (string expression: An
expression that evaluates to a sequence of contiguous characters. Elements of
the expression can be: functions that return a string or a string Variant
(VarType 8); a string literal, constant, variable, or Variant.) that's the
valid name of an object of the type selected by the objecttype argument.
Save Optional AcCloseSave A AcCloseSave constant tha specifies whether or
not to save changes to the object. The default value is acSavePrompt