C
Cynthia
I have a list box that I am allowing multiple selections on. I need to capture
columns 0 and 4 from the list of what is selected. Does any one know how to
do that. On the code below it errors out after running through one selection,
I get invalid use of null?
Column 4 is the order number they are placed in and I am trying to
move them up by lowering this number by one and upping the
number below to its value.
For Each varItem In Me.listCircList.ItemsSelected
id = Me.listCircList.Column(0)
num = Me.listCircList.Column(4)
newnum = num - 1
If num = 1 Then
MsgBox "Cannot move up already at Top of List"
Else
DoCmd.RunSQL "Update EleCircRoute set routenum = " & num & "
where CircID = " & CircID & " and routenum = " & newnum & ""
DoCmd.RunSQL "Update EleCircRoute set routenum = " & newnum
& " where ID = " & id & ""
Me.Refresh
End If
Next varItem
columns 0 and 4 from the list of what is selected. Does any one know how to
do that. On the code below it errors out after running through one selection,
I get invalid use of null?
Column 4 is the order number they are placed in and I am trying to
move them up by lowering this number by one and upping the
number below to its value.
For Each varItem In Me.listCircList.ItemsSelected
id = Me.listCircList.Column(0)
num = Me.listCircList.Column(4)
newnum = num - 1
If num = 1 Then
MsgBox "Cannot move up already at Top of List"
Else
DoCmd.RunSQL "Update EleCircRoute set routenum = " & num & "
where CircID = " & CircID & " and routenum = " & newnum & ""
DoCmd.RunSQL "Update EleCircRoute set routenum = " & newnum
& " where ID = " & id & ""
Me.Refresh
End If
Next varItem