First of all you are missing two .dlls in your .zip file:
Next, I see you have references to both DAO and ADODB in your project, unless you actually use both (and from what I see you are only using DAO) remove the one you are not using to avoid conflicts, OR specify which type you are using,
i.e. Dim rstdb1 As DAO.Recordset OR
Dim rstdb1 As ADODB.Recordset
Otherwise VB will pick which ever one it wants to... :(
Now to a possible soution.
An idea come to my mind as soon as I read your post and here it is.
Create a user defined type and a public variable of that type:
Public Type DBWords
DataID As Long
Used As Boolean
Public DBWordsArr() As DBWords
You do NOT want to set a limit here since you want to be able to resize it dynamically depending on the data in your DB.
Next you load your array with the IDs from your table PicSentenses and FALSE in the boolean part.
Set rstdb1 = db.OpenRecordset("SELECT ID FROM PicSentenses")
rstdb1.MoveLast 'Will get an accurate RecordCount
ReDim DBWordsArr(rstdb1.RecordCount -1)
i = 0
'Unless you want to use a 1-based array
'ReDim DBWordsArr(1 to rstdb1.RecordCount)
'i = 1
While Not rstdb1.EOF
DBWordsArr(i).DataID = rstdb1!ID
DBWordsArr(i).Used = False
i = i + 1
'ALWAYS close your recordsets in VB otherwise you are prone to memory leaks, yes EVEN in VB... :)
Set rstdb1 = Nothing
Then you use your random code to get the next array element to use verifying for Used, I would create a function that returns a new random number within the range of subscripts of DBWordsArr
i = GetNextElement()
i = GetNextElement()
Set rstdb2=db.OpenRecordset("SELECT * FROM PicSentenses WHERE ID = " & DBWordsArr(i).DataID)
To guard against a infinite loop I would also keep counters of how many items I have in the array and of how many I have used so far.
Whenever you visit on node of your array you set the Used flag to TRUE and then you cannot get that item back until you have gone through the entire array and reset all the Used flags to FALSE.
Hope this makes sense and that it helps
P.S. I have not tested this code as I just typed it here in the answer window... ;)