Hello,
I have the following piece of code where basically I am trying to choose from a combo box a value and based on that open the corresponding form to fill in other data.
The errormessage is as follows:
Run-Time Error 2501 the OpenForm action was cancelled.
Can anyone help please?
'-----
Private Sub Combo0_AfterUpdate()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FarmsFrm"
stLinkCriteria = "DistrVillFarm=" & Me![Combo0]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
I have the following piece of code where basically I am trying to choose from a combo box a value and based on that open the corresponding form to fill in other data.
The errormessage is as follows:
Run-Time Error 2501 the OpenForm action was cancelled.
Can anyone help please?
'-----
Private Sub Combo0_AfterUpdate()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FarmsFrm"
stLinkCriteria = "DistrVillFarm=" & Me![Combo0]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub