I'm very new to all of this so apologies for my inexperience. I have been slowly working on a new database in Access for work and have run into another road block.
I have never tried passing variables while calling a function so I don't know what the heck I'm doing. I'll give a simplified example of what I'm trying to do I was hoping someone would give some insight as to what I'm doing wrong. The second variable vRank is reporting properly but the first one vID gets "stuck" on whatever the first item in the listbox is. I was convinced I was doing something outside of the code that was causing the problem but I have run out of ideas as to what that would be. I would really appreciate if someone could look over the code and explain what I've done wrong or if the code should be working and I did screw up something in the setup.
Thanks!
I have never tried passing variables while calling a function so I don't know what the heck I'm doing. I'll give a simplified example of what I'm trying to do I was hoping someone would give some insight as to what I'm doing wrong. The second variable vRank is reporting properly but the first one vID gets "stuck" on whatever the first item in the listbox is. I was convinced I was doing something outside of the code that was causing the problem but I have run out of ideas as to what that would be. I would really appreciate if someone could look over the code and explain what I've done wrong or if the code should be working and I did screw up something in the setup.
Code:
Dim vrt As Variant
Dim upSQL As String
For vrt = 0 To Me.List1.ListCount - 1
If Me.List1.Selected(vrt) = True Then
Call ChangeUp(Me.List1.Column(0, vrt), Me.List1.Column(1, vrt))
End If
Next
End Sub
Sub ChangeUp(vID As Long, vRank As Long)
MsgBox vID & " " & vRank
End Sub
Thanks!