I’m using the following VBA code in Access:
Private Sub xx Click()
Dim strWhere As String
strWhere = "[EmploeeID]=" & [FatherNo]
Debug.Print strWhere
DoCmd.OpenForm "frmEmploees", acNormal, strWhere
End Sub
When I use it on a button in a single form, it works correctly and opens the expected record.
However, when I use the same code in a continuous form, it gives incorrect results.
Note that the FatherNo field contains duplicate values.
I need this code to work in the continuous form as it’s very important for my application. Does anyone know a solution or workaround?
Private Sub xx Click()
Dim strWhere As String
strWhere = "[EmploeeID]=" & [FatherNo]
Debug.Print strWhere
DoCmd.OpenForm "frmEmploees", acNormal, strWhere
End Sub
When I use it on a button in a single form, it works correctly and opens the expected record.
However, when I use the same code in a continuous form, it gives incorrect results.
Note that the FatherNo field contains duplicate values.
I need this code to work in the continuous form as it’s very important for my application. Does anyone know a solution or workaround?