Hi everyone,
I'm very new to Access, but I keep learning it with the help of this forum, but came up with the problem for which I can not find solution.
i'm runing code:
Private Sub Command44_Click()
Dim rsItems As ADODB.Recordset
Dim ID As Integer
Set rsItems = New ADODB.Recordset
ID = Me.txtID
rsItems.Open "SELECT * FROM tblRizika2Data WHERE (Data_ID= [ID])", CurrentProject.Connection, adOpenKeyset, adLockReadOnly
With rsItems
While Not .EOF
lstKlasifikacija.Selected(rsItems.Fields("Rizika_ID")) = True
.MoveNext
Wend
End With
rsItems.Close
Set rsItems = Nothing
End Sub
And get error message: "No value given for one or more parameters"
If I change ID to the exact number it stands for in the tblRizika2Data - everything works fine.
Any Ideas what is vrong with this code? Or maybe similar problem was already solved in this forum yet? I would be very thankful for the link to that post
I'm very new to Access, but I keep learning it with the help of this forum, but came up with the problem for which I can not find solution.
i'm runing code:
Private Sub Command44_Click()
Dim rsItems As ADODB.Recordset
Dim ID As Integer
Set rsItems = New ADODB.Recordset
ID = Me.txtID
rsItems.Open "SELECT * FROM tblRizika2Data WHERE (Data_ID= [ID])", CurrentProject.Connection, adOpenKeyset, adLockReadOnly
With rsItems
While Not .EOF
lstKlasifikacija.Selected(rsItems.Fields("Rizika_ID")) = True
.MoveNext
Wend
End With
rsItems.Close
Set rsItems = Nothing
End Sub
And get error message: "No value given for one or more parameters"
If I change ID to the exact number it stands for in the tblRizika2Data - everything works fine.
Any Ideas what is vrong with this code? Or maybe similar problem was already solved in this forum yet? I would be very thankful for the link to that post