Jump to content
Sign in to follow this  

Method parameters in COM

Recommended Posts


I've succesfully controlled Access forms with AutoIt/COM. But now there's a problem: how can I give parameters to a method? For example, there's a "Seek" method mentioned in the Access VBA manual:


recordset.Seek KeyValues, SeekOption

And I try to use it this way in the code:

$result = $objOrder.workOrders.Form.Recordset.Seek 1000, 1

If I try running the code, I get syntax error:

E:\AUTOIT\lopputesti\lopputesti.au3(221,44) : ERROR: syntax error
    $s = $oJob.showlabour.Form.Recordset.Seek 1000, 1
E:\AUTOIT\lopputesti\lopputesti.au3 - 1 error(s), 0 warning(s)

Share this post

Link to post
Share on other sites

For methods, use this syntax: $oObject.Method($parameter1, $parameter2)

Using your example:

$result = $objOrder.workOrders.Form.Recordset.Seek(1000, 1)

For properties, use:

$oObject.Property = $value


(Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this