E
Evan
Hi guys, I am sorry for the cross-post but I am experiencing a problem
that I just cant seem to sort out and I am beginning to think that for
something as simple as this - there may be no solution.
CURRENT SITUATION:
I have a database with 2 tables in it... the first table is users
(userID, userName) the second table is notes (noteID, userID, notes).
I have managed to populate a list box in a userform (MSWord) with all
the userNames from the user table. I would like to link the user names
to the userID's so I will be able to locate all the notes related to a
specific user from the notes table. The crux of the current code WHICH
WORKS looks like this...
Do While Not rec.EOF
With lstCategories
.AddItem rec("categoryName")
End With
rec.MoveNext
Loop
PROBLEM:
I have done a lot of research and found a function called ItemData
which is supposed to assist me in doing this. According to my research
(which my be applicable to VB only), the solution would look similar
to this:
Do While Not rec.EOF
With lstCategories
.AddItem rec("categoryName")
.ItemData(.NewIndex) = rec("categoryID") //NEW CODE - NOT
WORKING
End With
rec.MoveNext
Loop
When I execute the code above, I get an error - "Compile Error: Method
or data member not found", it then it proceeds to highlight the
..NewIndex function, even though I belive the error is with the
..ItemData function as that does not seem to be avaliable ?!?!
If there is anyone out there that can help me with this problem I
would greatly appreciate it.
Regards,
Evan
that I just cant seem to sort out and I am beginning to think that for
something as simple as this - there may be no solution.
CURRENT SITUATION:
I have a database with 2 tables in it... the first table is users
(userID, userName) the second table is notes (noteID, userID, notes).
I have managed to populate a list box in a userform (MSWord) with all
the userNames from the user table. I would like to link the user names
to the userID's so I will be able to locate all the notes related to a
specific user from the notes table. The crux of the current code WHICH
WORKS looks like this...
Do While Not rec.EOF
With lstCategories
.AddItem rec("categoryName")
End With
rec.MoveNext
Loop
PROBLEM:
I have done a lot of research and found a function called ItemData
which is supposed to assist me in doing this. According to my research
(which my be applicable to VB only), the solution would look similar
to this:
Do While Not rec.EOF
With lstCategories
.AddItem rec("categoryName")
.ItemData(.NewIndex) = rec("categoryID") //NEW CODE - NOT
WORKING
End With
rec.MoveNext
Loop
When I execute the code above, I get an error - "Compile Error: Method
or data member not found", it then it proceeds to highlight the
..NewIndex function, even though I belive the error is with the
..ItemData function as that does not seem to be avaliable ?!?!
If there is anyone out there that can help me with this problem I
would greatly appreciate it.
Regards,
Evan