?
Solved

Attaching Code to a form

Posted on 2002-07-11
3
Medium Priority
?
171 Views
Last Modified: 2010-04-08
Hi,

I am sure most will find this extremely easy but
its bugging me.
I have created a custom contacts form. I have attached
a command button that I want to use to call a VB app.
to diplay some data. How do I attach the code to the command button on my form. I am in design view of my custom form.
I have tried clicking properties.I would welcome any suggestions at all.
Do I have to use VB Script, and can I use ordinary VB or VBA instead of VBScript.

Thanks in advance

john
0
Comment
Question by:john1982
3 Comments
 
LVL 16

Accepted Solution

by:
Neo_mvps earned 200 total points
ID: 7145707
* Select Form | View code.

Now you just need to type 'Sub <name_of_control>_Click()' and type in your vbscript code and then finish it off with and End Sub.

Example for a command button named cmdReadData

Sub cmdReadData_Click ()
 ' Create some object if it has a COM interface
 ' read/write some data
 ' Cleanup any variables we don't need
 ' Release the the object
End Sub
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7347185
Hello john1982

this question is open for more then 2 months
time to clean up
if not stated otherwise

my recom will be
-PAQ
-points to Neo_mvps
-this will be finalized by an EE Moderator
-with no further update (26.10.2002)

PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER

HAGD:O)Bruintje
posted by ToolzEE v1.0
0
 

Expert Comment

by:Jgould
ID: 7375455
Question has been closed as per recommendation

JGould-EE Moderator
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
This article will help to fix the below errors for MS Exchange Server 2016 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question