|
-
Oct 5th, 2002, 10:02 AM
#1
Thread Starter
Lively Member
Optionboxes functions
I have a form full of Optionboxes...
All the OptionBoxes are with two of them together...
So I have for example:
Dog or Cat
Sheep or Cow
Fish or Bird
I want to write a function to return a 1 or a 0 to an integer...
VB Code:
Public Sub OneZero(One As Boolean, Zero As Boolean, intName As String)
If One = True Then
Name = 1
ElseIf Zero = True Then
Name = 0
End If
End Sub
I call this functions...
VB Code:
call OneZero(optDog, optCat, "intDogCat")
call OneZero(optCow, optSheep, "intSheepCow")
call OneZero(optFish, optBird, "intFishBird")
Problem now is I want the 1 or 0 into my intName instead of into Name...help!
-
Oct 5th, 2002, 10:08 AM
#2
-= B u g S l a y e r =-
Sorry, but I don't get it... could you please elaborate a bit ?
-
Oct 5th, 2002, 10:12 AM
#3
Thread Starter
Lively Member
Mhh...
Ok...
I have 2 optionboxes for every pair...
So I have optDog and optCat
if optDog is selected I want to have a "1" into my intDogCat, if optCat is selected I want to have a "0" into my intDogCat
-
Oct 5th, 2002, 10:37 AM
#4
The picture isn't missing
Public Sub OneZero(One As Boolean, Zero As Boolean, intName As Integer)
If One = True Then
intName = 1
ElseIf Zero = True Then
intName = 0
End If
End Sub
call OneZero(optDog, optCat, intDogCat)
call OneZero(optCow, optSheep, intSheepCow)
call OneZero(optFish, optBird, intFishBird)
try that
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Oct 5th, 2002, 10:40 AM
#5
Thread Starter
Lively Member
-
Oct 5th, 2002, 10:49 AM
#6
The picture isn't missing
??????? yes it does.... how are you doing it?
VB Code:
Private Sub Form_Load()
Dim optdog As Boolean
Dim optcat As Boolean
Dim intdogcat As Integer
optdog = False
optcat = True
Call OneZero(optdog, optcat, intdogcat)
MsgBox intdogcat
End Sub
Public Sub OneZero(One As Boolean, Zero As Boolean, intName As Integer)
If One = True Then
intName = 1
ElseIf Zero = True Then
intName = 0
End If
End Sub
Remember, if someone's post was not helpful, you can always rate their post negatively  .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|