Thanks Ben, buti am still having problems. let me give you some more info. I have one main form, that holds infomration on banks. I have anohter fomr set up called a comments form, that enables me to put commetns against each of these banks. i have a button that opens this form, but everytim i click on it, it states: ' Compile error. Only comments must appearafter end sub, end function or end property.' it then points to the follwoing code :
Private Sub open_comments_form_Click()
On Error GoTo Err_open_comments_form_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Comments"
stLinkCriteria = "[Bank Id]=" & Me![Bank Id]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_open_comments_form_Click:
Exit Sub
Err_open_comments_form_Click:
MsgBox Err.Description
Resume Exit_open_comments_form_Click
End Sub
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Comments"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_open_comments_form_Click:
Exit Sub
Err_open_comments_form_Click:
MsgBox Err.Description
Resume Exit_open_comments_form_Click
End Sub
It highlights dimstdoc name (above)
what do i do? i have tried to reset it, but the same errors come up.
Help?
Thanks in advance
Matt