Hi, all!
In my database, I'm using continuous forms to create search forms. I have a button that appears at the end of each row, and SHOULD allow the user to click and bring up the selected record in the full view form. However, when I click the button, one of two things happens:
1) There is one record in particular that will always pull up, without fail. If I click that one, it goes right in.
2) If I click ANY of the other records, it pulls the view form up as if to add a new record. The auto# primary key is even "(New)".
I've tried things I found online, and this is what's in it currently:
Code:
Private Sub btnView_Click()
On Error GoTo btnView_Click_Err
'Open policy view form to correct record on click.
'Declare variable.
Dim strWhere As String
strWhere = "[PolID] =" & Me.[ctlPolID]
DoCmd.OpenForm "frmPolicy3rd", , , strWhere
btnView_Click_Exit:
Exit Sub
btnView_Click_Err:
MsgBox Error$
Resume btnView_Click_Exit
End Sub
The "PolID" is an auto# primary key.
Can anyone tell why it might be behaving this way?