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
  #11 (permalink)  
Old July 13th, 2005, 10:41 AM
Authorized User
 
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok I'm sorry, what I mean is if the customer selects EURO then I don't want the customer to be able to select GBP also. SO if one is selected I want the other one to be grayed. If neither is selected I want the invoice form to show U.S. dollars by default.


I hope this helps

Reply With Quote
  #12 (permalink)  
Old July 13th, 2005, 12:11 PM
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

so your code fails why??

it's look ok for me.. what part is not doing the job?? when you click one check, the other grayed???

HTH

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

I can still click both checkboxes at the same time

Reply With Quote
  #14 (permalink)  
Old July 13th, 2005, 01:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The Value property of the checkbox control is not a boolean, but an int: vbChecked or vbUnchecked. A boolan False is 0, True is -1. Unchecked is 0, checked is 1.

Private Sub GBP_Click()
Euro.Value = iif(GBP.Value = vbChecked, vbUnchecked, vbChecked)
End Sub


Marco
Reply With Quote
  #15 (permalink)  
Old July 13th, 2005, 01:07 PM
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.. let's see..

if you trace the following code:
Code:
 
Private Sub GBP_Click()
If Me.GBP.Value = True Then
    Me.EURO.enabled= False
 Else
    Me.EURO.enabled= False
End If
End Sub
did this work??
it should be disabling one of them.. also you will have to uncheck it if when you disable it with

(thanks marco!) euro.value = vbunchecked

can you trace the code to see if no other part enable it again???

HTH

Gonzalo
Reply With Quote
  #16 (permalink)  
Old July 13th, 2005, 01:11 PM
Authorized User
 
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't get what your saying

Reply With Quote
  #17 (permalink)  
Old July 13th, 2005, 02:28 PM
Authorized User
 
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok guys I tried all your ideals, I don't know what I'm doing wrong

Reply With Quote
  #18 (permalink)  
Old July 13th, 2005, 02:46 PM
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

try this...

on a new form paste to check boxes and this code

Code:
Private Sub Check1_Click()
    If Check1.Value = vbChecked Then
        Check2.Enabled = False
    Else
        Check2.Enabled = True
    End If
End Sub

Private Sub Check2_Click()
    If Check2.Value = vbChecked Then
        Check1.Enabled = False
    Else
        Check1.Enabled = True
    End If
End Sub
and tell me if that is what you want.. if that is not then you are not explaining ok what you want...

HTH

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

Ok I'm so sorry after reviewing what I trying to accomplish I realized that I was writing the code in the wrong object. Thank you so much for your help.

Reply With Quote
  #20 (permalink)  
Old July 13th, 2005, 03:53 PM
Authorized User
 
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now I wrote the code to display U.S. Dollars as default if nothing is selected, however I need to write a line of code to clear the field so if I check EURO or GBP is will display that and not U.S. dollars. Here's the code I wrote. I also put the code for disabling the checkboxes just in case you wanted to see it.

Thank you

'If EURO is chcked display EURO on invoice form
If Forms![Invoice Scanner].EURO = True Then
   Forms![Invoice Scanner]!InvSub.Form!CurPayIn = "EURO"
Else
    Forms![Invoice Scanner]!InvSub.Form!CurPayIn = "U.S. Dollars"
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"
Else
    Forms![Invoice Scanner]!InvSub.Form!CurPayIn = "U.S. Dollars"

End If



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

End If
End Sub


'Disabling Checkboxes
Private Sub EURO_Click()

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

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 01:26 PM.


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