Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Click a button on an Access form
Message
From
30/09/2008 14:55:37
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01351878
Message ID:
01351887
Views:
37
>>I've got to the point where I can get a reference to a button on the Access form, but can't get it to do anything. oCmd.click returns a COM error (unknown name or some such), loDoCmd.run("cmdbutton_click") also doesn't... and of course I don't have access (pardon the poor pun, don't execute it) to the source code; I can get to the PEM window, but it's actually a property window, no E or M, can't see any code, only module names.
>>
>>Regarding any legalese concerns: the app is abandonware; I know the guy who wrote it and he vanished. I just want to make life simpler to my users, who have the licenses for this thing. I'd rather spend another day coding around this than to talk them through steps, what to do when and what to do when such-and-such message appears.
>>
>>So, my question is, how do I run the code which would run when oCmd is clicked? The P window says "[Event Procedure]".
>
>Form Objects in VB (and .NET for that matter) don't have associated event-methods like VFP. To call the Click event you have to call the Method that is bound the Click Event. In this case "cmdButton_Click" which is a member of the Form. Try getting a reference to the form and calling the cmdButton_Click method
>
>
>oForm.cmdButton_Click()
>
Tried that, but I'm getting a "OLE error code 0x800a09a1: Unknown COM status code." Could it be that _click() is protected somehow so I not only can't see the source, but can't run it via automation either?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform