473,326 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Forms in general (a simple question)

It is really a simple question.

Visual Basic .NET (2003)

I create 2 forms (Form1 and Form2)

I create a checkbox in Form1 (checkbox1)
I create a checkbox in Form2 (checkbox1)
I go to Form1 doubleclick on checkbox1 and alters the code

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles CheckBox1.CheckedChanged
' here begin the alteration
If CheckBox1.Checked = True Then
Form2. ' here begins the problem, i want to set the control in
form2 the same as in form1
End If
End Sub

The question is very simple
Why can i not refer to a control in form2 from form1. there was no problem
in VB6
Nov 21 '05 #1
2 1155
You can refer to a control in Form2 but you must have a reference to
Form2 in order to do. How are you creating your reference to Form2?
Somewhere in your code you must have something similar to this:

Dim MyForm2 As New Form2
Then you can access the checkbox on Form2 like this:

MyForm2.Checkbox1.Checked = True

Hope this helps

Chris

Nov 21 '05 #2
YES it helps, i said it vould be simple

THANK YOU

"Chris Dunaway" wrote:
You can refer to a control in Form2 but you must have a reference to
Form2 in order to do. How are you creating your reference to Form2?
Somewhere in your code you must have something similar to this:

Dim MyForm2 As New Form2
Then you can access the checkbox on Form2 like this:

MyForm2.Checkbox1.Checked = True

Hope this helps

Chris

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: calfliu | last post by:
hello: everybody! I have a simple question. How can I translate the selected value from art to recipient(hidden input button)? <form name="send" method="post" action="send.cgi"> <select...
0
by: steve w | last post by:
Hi there I'm trying to do something that in ASP I could do easily. I want a form which will... 1. Bind a record from a database to the text boxes etc. if the user has come from a summary...
3
by: Lauren Quantrell | last post by:
A general design question: Assuming I can figure out a way to link some local tables in an .MDB file to my Access2000 .ADP database (any help on this is appreciated as well), I'm wondering which...
3
by: Peter | last post by:
Hello Thanks for reviewing my question. I have a simple question. I would like to know how you can arrange the docking order? For example, when I add a toolbar and I set the dock to TOP and...
1
by: Chris | last post by:
Sorry to ask such a simple question but here it is, and I'm am new to ASP/WEB I am designing a site and I want to make it general so I can easily change the font/color/sizes of the...
7
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
2
by: ZorpiedoMan | last post by:
I'm new to the world of sockets, and this question is not VB specific: If multiple clients access the same server on the same port, and the server is set up to do some async communication, does...
2
by: njuneardave | last post by:
Hey, this is a simple question. I am new to the whole visual C# scene. I am creating a simple "Find Word" dialog box. I have the menu working: File -> Find -> Find Word....then it pops up my...
9
by: ofiras | last post by:
Hii everyone, I have a basic simple question, that I coulde't find the answer for: How can I query from a db with SQL? I know SQL, and if I want to send a query like this: "SELECT * FROM...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.