how can i link a checkbox in visual basic to a database? 
Author Message
 how can i link a checkbox in visual basic to a database?
how can i link a checkbox in visual basic to a database?

whit a text box you use
set text1.datasource= therecordset
text1.datafield="field"            from te database

but whit a checkbox you dont have datasource and datafield....

how can i do that

please help me




Mon, 17 Dec 2001 03:00:00 GMT
 how can i link a checkbox in visual basic to a database?

The checkbox is not a bound control. This probably doesn't mean you can't
make it so with API calls but I have no clue...

Try something tricky like using a checkbox and a text box. Make the text box
look like a lable, then align them on your form so the textbox (now looks
like a lable) looks like a normal check box.

In the checkbox click event, trigger some code in the textbox change
event... For example maybe some of the code you would normally write for the
checkbox click event is handled in the textbox change event.

Don't know if all of this will work but that's how I would start attacking
the problem...

Quote:

>how can i link a checkbox in visual basic to a database?

>whit a text box you use
>set text1.datasource= therecordset
>text1.datafield="field"            from te database

>but whit a checkbox you dont have datasource and datafield....

>how can i do that

>please help me





Mon, 17 Dec 2001 03:00:00 GMT
 how can i link a checkbox in visual basic to a database?

Quote:

>how can i link a checkbox in visual basic to a database?

>whit a text box you use
>set text1.datasource= therecordset
>text1.datafield="field"            from te database

>but whit a checkbox you dont have datasource and datafield....

CheckBox.Value = -therecordset.fields("field")

note the minus sign.

Assuming the field in a boolean the values are 0 False or -1 True
Check box values are the minus of this 0 Unchecked or 1 Checked

jeff



Tue, 18 Dec 2001 03:00:00 GMT
 how can i link a checkbox in visual basic to a database?

Quote:

>The checkbox is not a bound control. This probably doesn't mean you can't
>make it so with API calls but I have no clue...

If you haven't got a clue don't give an answer.

Stop your car on a busy street and open up the hood / bonnet. Suck you
teeth and scatch your head and you will get plenty of geeks stoping
and saying "I'm not expert but I think its the fan belt", "water
pump", "alternator", "distributer", "coil", "panty hose","widget nuts"
and etc

As for code. Yes API does it all. We don't know anything about API but
because it is complicated it must be good. Cures warts, boils, and
bumps on the head.

Jeff



Tue, 18 Dec 2001 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Visual Basic linking to a Foxpro Database

2. Link Visual basic to progress database

3. OH-CINCINNATI-105470--Visual Basic-ORACLE-Visual C++-MFC-OOD-Visual Basic Programmer

4. Link Visual basic to progress database

5. OH-CINCINNATI-105470--Visual Basic-ORACLE-Visual C++-MFC-OOD-Visual Basic Programmer

6. OH-CINCINNATI-105470--Visual Basic-ORACLE-Visual C++-MFC-OOD-Visual Basic Programmer

7. IL-CHICAGO-138941--Visual Basic-SQLSERVER-RDBMS-ORACLE-Management-Visual Foxpro-Visual Basic Developer


 
Powered by phpBB® Forum Software