I have created a 2007 Access Database form in which I want to use to test myself in studying definitions. The form has the definition from "Table1" and a list box which pulls from a query with ALL the words in "table1". I have added a Click Event to the list box. When I click on the word in the list box, I want it to give me a messagebox saying "you are correct" or "your are incorrect". That is if the definition showing matches the word i click on. They would be the same record in the table1. The field names are "definition" and "word". Here is my VB code:
Private Sub LstWordList_Click()
If LstWordList.Selected = table1.Word Then
MsgBox "you are correct"
Else
MsgBox "you are incorrect"
End If
The error i'm getting is:
Compiler error:
Argument not optional
the word .selected is highlighted in yellow.
I'm not sure where I'm going wrong here, but I think it's relatively simply, just can't put my finger on it.
I'm not sure if I need to declare the database or table?
Any help is appreciated.
Private Sub LstWordList_Click()
If LstWordList.Selected = table1.Word Then
MsgBox "you are correct"
Else
MsgBox "you are incorrect"
End If
The error i'm getting is:
Compiler error:
Argument not optional
the word .selected is highlighted in yellow.
I'm not sure where I'm going wrong here, but I think it's relatively simply, just can't put my finger on it.
I'm not sure if I need to declare the database or table?
Any help is appreciated.