V
Vince
I have a form based on a linked table in Oracle. In that table, I have
column in my table which uses 1 = true/on/yes and 0 = false/off/no.
Due to Access form's checkbox control using -1 for "on/true/yes, in my
form, I unbound the column and put some simple code in the on
Forms_Current event, using a common module so all forms can use this
logic:
Private Sub Form_Current()
Me.chkboxIsActive.Value = modUtil.db2ChkBoxVal(Me.IS_ACTIVE)
End Sub
Public Function db2ChkBoxVal(dbValue As Integer) As Integer
If dbValue = 1 Then
db2ChkBoxVal = -1
Else
db2ChkBoxVal = 0
End If
End Function
I reverse the process in the Form_BeforeUpdate event.
This seems to work as expected as far as a single row is concerned.
However, in the tabular form I built (shows many records from the DB),
the unbound control seems to effect all records. If I check/uncheck
the first row's checkbox, all rows values are changed. Ditto updating
any row's checkbox. Is there a way to achieve the unbound control's
behaviour on a row-by-row basis?
- Vince
column in my table which uses 1 = true/on/yes and 0 = false/off/no.
Due to Access form's checkbox control using -1 for "on/true/yes, in my
form, I unbound the column and put some simple code in the on
Forms_Current event, using a common module so all forms can use this
logic:
Private Sub Form_Current()
Me.chkboxIsActive.Value = modUtil.db2ChkBoxVal(Me.IS_ACTIVE)
End Sub
Public Function db2ChkBoxVal(dbValue As Integer) As Integer
If dbValue = 1 Then
db2ChkBoxVal = -1
Else
db2ChkBoxVal = 0
End If
End Function
I reverse the process in the Form_BeforeUpdate event.
This seems to work as expected as far as a single row is concerned.
However, in the tabular form I built (shows many records from the DB),
the unbound control seems to effect all records. If I check/uncheck
the first row's checkbox, all rows values are changed. Ditto updating
any row's checkbox. Is there a way to achieve the unbound control's
behaviour on a row-by-row basis?
- Vince