Really wierd problem opening a form with selection.
I use this code on a button:
On Error GoTo Err_Command8_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_ADv5"
If Forms!frm_ADv5_List!keyADv5 <0 Then
stLinkCriteria = "((keyADv5 = " & Me.keyADv5 & "))"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
End If
Exit_Command8_Click:
I know the code is going through the first part of the IF condition.
The stLinkCriteria = ((keyADv5 = 14))
When I click on the icon, it opens up the form, but a blank form. The
filter icon is highlighted. If I mouse over, it says "Remove FIlter".
If I click on it, then form then displays the proper filtered record.
I checked in Design mode the form, after it was opened,and it has Allow
Filters = YES and Filter = ((keyADv5 = 14))
This is wierd. I have used similar code before without any problems.
What am I missing? Hopefully something simple.
Bob