D
Dave
I'm having a problem when I click on a checkbox bound to
a 'bit' field in SQL server. I set the recordsource in
the onload event to a recordset. I can change the values
in other fields, (even a text field linked to the 'bit'
field where I type either 'True' or 'False'), but when I
click on a checkbox field bound to the 'bit' field,
Access will crash.
To reproduce the error, create a new ADP file and connect
it to the 'NorthwindCS' database. Create a form based on
the 'Product' table including the 'Discontinued' field
which is defined as type 'bit'. In the onload event enter
the following code:
Private Sub Form_Load()
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "SELECT * FROM Products",
CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Set Me.Recordset = rs
Set rs = Nothing
End Sub
When you click on the CheckBox bound to
the 'Discontinued' field the system crashes, but not when
you have a text field where you can type True or False.
The same form will work OK if you set the record source
this way:
Me.RecordSource = "SELECT * FROM Products"
Has anyone else encountered this problem? Is this a known
issue? Is there another way to set the recordsource to a
recordset?
a 'bit' field in SQL server. I set the recordsource in
the onload event to a recordset. I can change the values
in other fields, (even a text field linked to the 'bit'
field where I type either 'True' or 'False'), but when I
click on a checkbox field bound to the 'bit' field,
Access will crash.
To reproduce the error, create a new ADP file and connect
it to the 'NorthwindCS' database. Create a form based on
the 'Product' table including the 'Discontinued' field
which is defined as type 'bit'. In the onload event enter
the following code:
Private Sub Form_Load()
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "SELECT * FROM Products",
CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Set Me.Recordset = rs
Set rs = Nothing
End Sub
When you click on the CheckBox bound to
the 'Discontinued' field the system crashes, but not when
you have a text field where you can type True or False.
The same form will work OK if you set the record source
this way:
Me.RecordSource = "SELECT * FROM Products"
Has anyone else encountered this problem? Is this a known
issue? Is there another way to set the recordsource to a
recordset?