Reputation: 49
I receive this message in vba, can someone analyse this question? I have to finish this work, however it's been shown difficult with this errors.
Private Sub ListTarefas_DblClick()
Dim idtarefas As Integer
Dim func As Integer
Set rst = New ADODB.Recordset
ShowEquipa
Form_Projetos.List0.RowSource = ""
idtarefas = ListTarefas.Column(0, ListTarefas.ListIndex)
rst.Open "SELECT * FROM Equipas WHERE [ID-Tarefa] LIKE '" & idtarefa & "' " & _
";", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
With Form_Projetos
.List0.RowSourceType = "Value List"
Do Until rst.EOF
func = rst.Fields("ID-Func").value
.List0.AddItem (func)
rst.MoveNext
Loop
End With
rst.Close
End Sub
Upvotes: 0
Views: 4210
Reputation: 91376
You are missing an argument, not
Private Sub ListTarefas_DblClick()
But
Private Sub ListTarefas_DblClick(Cancel As Integer)
The error message is typical for a missing argument.
I do not see why you are taking such a long way around when Access accepts an SQL statement as a row source.
Upvotes: 1