Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding data to a form before it is displayed on screen

Posted on 2004-10-26
5
Medium Priority
?
151 Views
Last Modified: 2010-05-02
I want to pass data to several checkboxes on a form before it is shown on the screen. I have a trend display with several traces on it. Everytime you want to hide a trace you have to go into a config page and set the linestyle to "none" - a bit of a pain. What I want to do is have a form (which is activated from a pushbutton) that will check the trend for how many traces there are, and select/deselect the relevant checkbox based on if the trace is present (the line style is not set to "none") - the trend is limited to only 8 traces, so if there are 6 traces on the trend, only the first 6 checkboxes will be "ticked".

After the form is shown, when a checkbox is then "unticked" the linestyle for the trace is set to none, thus not showing the trace on the trend.

I've created the form with checkboxes and labels, I can detect if a trend has been selected, I can get the number of traces on the trend and I can check what linestyle is, I just don't know how to populate the checkboxes on the form automatically.

Help Please - Caffreys.
0
Comment
Question by:caffreys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 375 total points
ID: 12412199
'Have you tried:

Load Form2
Form2.Check1.Value = 1
Form2.Check2.Value = 1
Form2.Show
0
 
LVL 14

Expert Comment

by:Shiju Sasidharan
ID: 12413873
Hi

Also keep in mind that  the statement
 
   Check1.Value = 1

unlike Radio button this will invoke the Check1_Click() Event aswell

;-)
Shiju

0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12414466
I would make a

form1

dim m_grade as long
Public Sub InitializeForm(Grade as long)
m_grade = Grade
End Sub


Form2

dim Frm as new Form1
frm.InitializeForm(34)
load frm
0
 
LVL 1

Expert Comment

by:atheekurrahman
ID: 12470961
have a few global var to store the traces

private sub Form_load()
      me.show
      ' code to tick the check boxes depending on the global var
end sub
0
 

Author Comment

by:caffreys
ID: 12471678
Thanks vinnyd79, that worked fine. The other suggestions may have worked as well, but yours was the first I tried and it worked for me.

Caffreys
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

618 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