Adding data to a form before it is displayed on screen

Posted on 2004-10-26
Medium Priority
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.
Question by:caffreys
LVL 28

Accepted Solution

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

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

Expert Comment

by:Shiju Sasidharan
ID: 12413873

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

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


LVL 48

Expert Comment

ID: 12414466
I would make a


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


dim Frm as new Form1
load frm

Expert Comment

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

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

Author Comment

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.


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

624 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