Hi everyone,
I use the following code to generate a recordset (ADO) in the afterupdate-event of a combox (passing a parameter to a view) to populate a (single) form. It works ok, except that recordset is not updatable (the uniquetable property is set - if I make the view the recordsource of the form, the view is updatable). I think I have to set CursorType and Locktype, but don't how. Any tips?
Pampers![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
Just back from holiday...
that may it explain it.
I use the following code to generate a recordset (ADO) in the afterupdate-event of a combox (passing a parameter to a view) to populate a (single) form. It works ok, except that recordset is not updatable (the uniquetable property is set - if I make the view the recordsource of the form, the view is updatable). I think I have to set CursorType and Locktype, but don't how. Any tips?
Code:
Private Sub FilterVoyage_AfterUpdate()
Dim Cmd As ADODB.Command
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Set Cmd = New ADODB.Command
Set rs = New ADODB.Recordset
With Cmd
.CommandText = "vwTest"
.CommandType = adCmdUnknown
Set prm = .CreateParameter("VoyageID", adInteger, adParamInput)
.Parameters.Append prm
.Parameters("VoyageID") = Me.FilterVoyage
.ActiveConnection = CurrentProject.Connection
Set rs = .Execute
End With
Set Me.Recordset = rs
End Sub
Pampers
![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
Just back from holiday...
that may it explain it.