Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 12th, 2005, 02:00 PM
Authorized User
 
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Disable Check Boxes

Hello,

I need help with disabling one check box when another checkbox is selected on a form I built in Access?
Reply With Quote
  #2 (permalink)  
Old July 12th, 2005, 03:30 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

This is easiest if you use radio buttons (the round dealies with a dot in the middle), and put several of then into a frame. If one is selected, the others are automatically cleared.
Reply With Quote
  #3 (permalink)  
Old July 13th, 2005, 08:38 AM
Authorized User
 
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for your help, but my customer requested checkboxes.

Reply With Quote
  #4 (permalink)  
Old July 13th, 2005, 08:45 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

just put in the click event some code to disable the rest of the checks...
you have to do this for every check box...

HTH

Gonzalo
Reply With Quote
  #5 (permalink)  
Old July 13th, 2005, 09:29 AM
Authorized User
 
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is the code I came up with so far but its not working.

Private Sub GBP_Click()
If Me.GBP.Value = True Then
    Me.EURO.Enabled = False
 Else
    Me.EURO.Enabled = True
End If
End Sub

Private Sub EURO_Click()
If Me.EURO.Value = True Then
    Me.GBP.Enabled = False
 Else
    Me.GBP.Enabled = True

End If
End Sub


Reply With Quote
  #6 (permalink)  
Old July 13th, 2005, 09:41 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi..

you dont have to use the disable property, use the value property and set it to false.



HTH

Gonzalo
Reply With Quote
  #7 (permalink)  
Old July 13th, 2005, 10:22 AM
Authorized User
 
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I switched the code and its still not working, maybe the rest of the code for this from will help.

Option Compare Database

Private Sub EURO_Click()
If Me.EURO.Value = True Then
    Me.GBP.Value = False
 Else
    Me.GBP.Value = False

End If
End Sub

Private Sub Form_Click()

End Sub

Private Sub Form_Close()
Forms![Invoice Navigator].List0 = ""
Forms![Invoice Navigator].List3 = ""
[Form_Invoice Navigator].Refresh
End Sub

Private Sub Form_Current()
'disable editing if contract is closed
If Me.Closed.Value = True Then
    Me.AllowEdits = False
    Me.lblContractClosed.Visible = True
Else
    Me.AllowEdits = True
     Me.lblContractClosed.Visible = False
End If

End Sub

Private Sub Form_Open(Cancel As Integer)
'disable editing if contract is closed
If Me.Closed.Value = True Then
    Me.AllowEdits = False
    Me.lblContractClosed.Visible = True
Else
    Me.AllowEdits = True
     Me.lblContractClosed.Visible = False
End If

'If EURO is chcked display EURO on invoice form
If Forms![Invoice Scanner].EURO = True Then
   Forms![Invoice Scanner]!InvSub.Form!CurPayIn = "EURO"


End If
' If GBP is checked on the contracts then display GBP on Invoice
If Forms![Invoice Scanner].GBP = True Then
    Forms![Invoice Scanner]!InvSub.Form!CurPayIn = "GBP"


End If

If Me.EURO.Value = True Then
    Me.GBP.Enabled = False
 ElseIf GBP.Value = True Then
    Me.EURO.Enabled = False
Else
    Me.EURO.Enabled = True
    Me.GBP.Enabled = True
End If



End Sub

Private Sub GBP_Click()
If Me.GBP.Value = True Then
    Me.EURO.Value = False
 Else
    Me.EURO.Value = False
End If
End Sub


Reply With Quote
  #8 (permalink)  
Old July 13th, 2005, 10:26 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi again...

what kind of error are you getting???

that will be more usefull than the code..

anyway remember that value property works with numbers, not boolean, you should be passing 0 to clear it (if my memory doesnt fail)...

HTH

Gonzalo
Reply With Quote
  #9 (permalink)  
Old July 13th, 2005, 10:31 AM
Authorized User
 
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't get en error when I run the code.

Reply With Quote
  #10 (permalink)  
Old July 13th, 2005, 10:36 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

ok.. so try to explain your problem better..

you want to disable the check when the other is selected.. by disable you mean unchecked or grayed???

why the last code didnt work???

HTH

Gonzalo
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop over check boxes sams ASP.NET 1.0 and 1.1 Professional 5 July 17th, 2007 06:26 AM
Help with VBA Disable/Enable text boxes yayomayn Access VBA 4 February 10th, 2007 08:43 PM
Check Boxes Allan320 Access VBA 3 June 2nd, 2006 05:45 AM
Using check boxes to filter dstein4d Access VBA 13 January 25th, 2006 07:50 PM
Getting value of Dynamic Check boxes kathryne Classic ASP Databases 3 March 19th, 2004 05:44 AM



All times are GMT -4. The time now is 06:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.