Problem: When clicking on an option button I would like to store a value (1 or 0) in a database. I'm using DAO.
Also what about staying on the same record to fill in each field with a 1 or 0
Does anybody have a block of code for this?
Printable View
Problem: When clicking on an option button I would like to store a value (1 or 0) in a database. I'm using DAO.
Also what about staying on the same record to fill in each field with a 1 or 0
Does anybody have a block of code for this?
Could you not just use
If opt1.value = 0 then
sSql = sSql & ", 0"
else
sSql = sSql & ", 1"
end if
That is if the option button value is returned in code as 0/-1 or is that the check box, I can never remember. sSql being the string that you want to execute against the database.
You would be better using a Check box which returns 1 or 0. This can be bound directly to your table.
If you have a group of mutually exclusive options then you will need more than 1 and 0 to indicate which value is selected - if they are not exclusive then use Check Boxes.
Cheers,
Paul.