You are here:

Visual Basic/vb 6.0 blood group form

Advertisement


Question
I have created a option button form for blood grup in which i will let to choose user blood group from option buttons A,B,AB and O. so i want to then connect that info to the access database which i have connected through module and save that info of blood group to that name ! so can you give me coding for option button?? n plz tell me how should i connect that info?? beacause my other forms have already connected to databse each form having separate table so may be i will create separate table for this blood form too...

Answer
As far as I know option buttons will not work in a manner like you want to do.  

You will need to write code to do what you want.  You will need either if else statements or case statements both will work equally well.

So the first couple could be something like:

if tableobject!bloodtype = "A" then
OptionButtonA = True

Elseif tableobject!bloodtype ="AB" then
OptionButtonAB = True

etc etc

finally you would need a fail safe for situations where the blood type is unknown for example
else
OptionButtonUnknown = true

End if

tableobject refers to your actual database/table
The ! tells VB to look at a specific field
bloodtype refers to the field name

With out knowing the specifics of your program or your objective it is hard to give you specific advise but this should get you started in the right direction.

Visual Basic

All Answers


Answers by Expert:


Ask Experts

Volunteer


Kevin Watkins

Expertise

I have written several programs integrating with MS Office including Access, Excel, and Word. I have used control arrays as well as data arrays, text files. I have an associates degree in programming. Please do not ask questions about VBA or dot net. I can only answer questions about Visual Basic 6.

Experience

I have written several programs integrating with MS Office including Access, Excel, and Word. I have used control arrays as well as data arrays, text files. I have an associates degree in programming.

Education/Credentials
I have an associates degree in computer programming.

©2016 About.com. All rights reserved.