OpenForm problem

adamides

New member
Local time
Today, 19:41
Joined
Dec 30, 2001
Messages
8
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
 
When do you get this error? I tried your code and it works fine for me so I am not sure what is going on but I suspect it has to do with something other than this code.
 

Users who are viewing this thread

Back
Top Bottom