Hi, i've been having some trouble with runtime error 2465- "Microsoft access cant find the field "I" referred to in your expression"
I'm trying to select a record from a list box and then open a form with that records details filled out in the fields of the form. Both ISBN and Copy No are key fields if this makes a difference.
Heres the code:
Private Sub DeleteBook_Click()
Dim strDocName As String, strCriteria As String
Dim strCaption As String, strPupil As String
strDocName = "frmDeleteBooks"
strCriteria = ("ISBN='" & Me![LstBooks] & "'") And ([Copy No] = Me![LstBooks].Column(1))
DoCmd.OpenForm strDocName, , , strCriteria
End Sub
I can get it to open a form with the right ISBN but i have trouble getting it to take the Copy No into account aswell. ISBN is a string, Copy No is an integer.
Any help is appreciated.
I'm trying to select a record from a list box and then open a form with that records details filled out in the fields of the form. Both ISBN and Copy No are key fields if this makes a difference.
Heres the code:
Private Sub DeleteBook_Click()
Dim strDocName As String, strCriteria As String
Dim strCaption As String, strPupil As String
strDocName = "frmDeleteBooks"
strCriteria = ("ISBN='" & Me![LstBooks] & "'") And ([Copy No] = Me![LstBooks].Column(1))
DoCmd.OpenForm strDocName, , , strCriteria
End Sub
I can get it to open a form with the right ISBN but i have trouble getting it to take the Copy No into account aswell. ISBN is a string, Copy No is an integer.
Any help is appreciated.