Solved

Attaching Code to a form

Posted on 2002-07-11
3
159 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 50 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

If you don't know how to downgrade, my instructions below should be helpful.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
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…

786 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