Why would a bound ComboBox object not allow me to edit contents?

  • Thread starter AccessDatabaseUserInNeedOfHelp2005_01_07
  • Start date
A

AccessDatabaseUserInNeedOfHelp2005_01_07

Reiterating the question:
Why would a (ADO Recordset) bound ComboBox control not allow me to edit
contents?

pick or edit is not allowed.

Here's the pseudo code:
Set Me.Form.Recordset = rst_recordsetname
Me.DataEntry = False
Me.AllowAdditions = False
Me.AllowEdits = True
Me.AllowDeletions = False
Me!cmb_box.ControlSource = rst_ext_sDebt_Nums.Fields("values_for_combo").Name
Forms!frmUpdates!cmbDebtNum.Locked = False
 
B

Brendan Reynolds

In an Access 2000 MDB, assigning an ADO recordset to a form's Recordset
property makes the form read-only. In Access 2003, the form can be
read-write, but you have to set the CursorLocation, CursorType, and LockType
properties of the recordset - as always with ADO recordsets, if you accept
the defaults, you get a read-only recordset.

I don't currently have access (no pun intended) to an Access 2002
installation, but if I remember correctly I believe that in a recent
discussion on the subject someone reported that the behaviour in Access 2002
was the same as in Access 2003.

Here's an example that, in Access 2003, results in a read-write form ...

Option Compare Database
Option Explicit

Private mrst As ADODB.Recordset

Private Sub Form_Close()

If Not mrst Is Nothing Then
If mrst.State <> adStateClosed Then
mrst.Close
End If
End If

End Sub

Private Sub Form_Open(Cancel As Integer)

Set mrst = New ADODB.Recordset
With mrst
.ActiveConnection = CurrentProject.Connection
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Source = "SELECT * FROM tblSource"
.Open
Debug.Print (.CursorType = adOpenStatic)
End With
Set Me.Recordset = mrst

End Sub
 
A

AccessDatabaseUserInNeedOfHelp2005_01_07

It didn't work. thank you so much for your reply. it was very insightful.
 
A

AccessDatabaseUserInNeedOfHelp2005_01_07

I'd like to thank you for your time.

Brendan Reynolds said:
In an Access 2000 MDB, assigning an ADO recordset to a form's Recordset
property makes the form read-only. In Access 2003, the form can be
read-write, but you have to set the CursorLocation, CursorType, and LockType
properties of the recordset - as always with ADO recordsets, if you accept
the defaults, you get a read-only recordset.

I don't currently have access (no pun intended) to an Access 2002
installation, but if I remember correctly I believe that in a recent
discussion on the subject someone reported that the behaviour in Access 2002
was the same as in Access 2003.

Here's an example that, in Access 2003, results in a read-write form ...

Option Compare Database
Option Explicit

Private mrst As ADODB.Recordset

Private Sub Form_Close()

If Not mrst Is Nothing Then
If mrst.State <> adStateClosed Then
mrst.Close
End If
End If

End Sub

Private Sub Form_Open(Cancel As Integer)

Set mrst = New ADODB.Recordset
With mrst
.ActiveConnection = CurrentProject.Connection
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Source = "SELECT * FROM tblSource"
.Open
Debug.Print (.CursorType = adOpenStatic)
End With
Set Me.Recordset = mrst

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top