|
-
Dec 8th, 2009, 02:52 AM
#1
Thread Starter
New Member
How to code the grand children?
Suppose I create a Form in Run time say Form1, and add a control say cmd1. If the user clicks the cmd1 then we have to close the Form but how to attach code to that control, exactly an event procedure for that cmd1. I want to understand the fundamentals. Thanks in advance.
-
Dec 8th, 2009, 05:54 AM
#2
Re: How to code the grand children?
Double click on the control, this will bring up your code window. It will look something like this
Private Sub CommandButton1_Click()
End Sub
This is your control sub procedure for the click event, any code you write in there will execute when you click your command button.
So now to close you form you have 2 options
Unload Me & Me.Hide
Unload Me completely unloads the form, Me.Hide as the name suggests only hides the form allowing you to quickly make it visible again be using Me.Show.
Add them in you event handler -
Private Sub CommandButton1_Click()
Unload Me
End Sub
Please Mark your Thread "Resolved",  if the query is solved & Rate those who have helped you
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|