?
Solved

Check Box - For smart ppl

Posted on 2000-04-04
5
Medium Priority
?
147 Views
Last Modified: 2010-05-18
I have a problem. I am new to VB and was hoping if any of you could help me out.

I've created a several check boxes but once my click on the box it carries out my procedure. I would like to reverse his procedure to how it was before i clicked on it.

How can i do this ???

Below is a sample of a coding. Ignore the actual structure.

Within the checkbox click command>>>

Image1.visibility = true
Image2.visibilty = false


When clicked>>>Image1 shows and image 2 disappears.

I would like to reverse the process when i click again.

I would appreciate any help !!!

thank you
0
Comment
Question by:m0ley
[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
  • 3
5 Comments
 
LVL 1

Accepted Solution

by:
riduce earned 200 total points
ID: 2684915
Here is you're answer

Private Sub Check1_Click()
If check1.value = 0 then image1.visible = false: image2.visible = true
if check1.value = 1 then image1.visible = true : image2.visible = false
End Sub
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2684932
Private Sub Form_Load()
    Image1.Visible = (Check1.Value = vbChecked)
    Image2.Visible = Not (Check1.Value = vbChecked)
End Sub

Private Sub Check1_Click()
    Image1.Visible = (Check1.Value = vbChecked)
    Image2.Visible = Not (Check1.Value = vbChecked)
End Sub
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2684962
A little improvement:

Private Sub Form_Load()
    Image1.Visible = (Check1.Value = vbChecked)
    Image2.Visible = Not Image1.Visible
End Sub

Private Sub Check1_Click()
    Image1.Visible = (Check1.Value = vbChecked)
    Image2.Visible = Not Image1.Visible
End Sub
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2684975
Even better:

Private Sub Form_Load()
    Check1_Click
End Sub

Private Sub Check1_Click()
    Image1.Visible = (Check1.Value = vbChecked)
    Image2.Visible = Not Image1.Visible
End Sub
0
 

Author Comment

by:m0ley
ID: 2685411
Cheers mate

It worked like a charm !!! :-)

Much appreciated and thank you once again
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
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 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…
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…
Suggested Courses
Course of the Month8 days, 14 hours left to enroll

764 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