Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter form with cirteria that changes.

Status
Not open for further replies.

Rufusjeep

Technical User
Nov 6, 2001
10
US
Have a search results form that is setup as a continuous form, when user double click on the case number it is to open a case review form for them to the set that they had select from the continuous form.

Problem is that I can get the form to open, however when applying the filter I get an error.
Here is the error:
Run-Time Error '2001':
You canceled the previous operation.

Here is the code that I am using to open the form and apply the filter.

Dim stFilter As String

stFilter = "CASE_NUMBER = " & Me!CASE_NUMBER
DoCmd.OpenForm "frmCaseHearingView", acNormal
Forms!frmCaseHearingView.Filter = stFilter
Forms!frmCaseHearingView.FilterOn = True

Thanks for the help in advance,

Mike
 
stFilter = "CASE_NUMBER = " & Me!CASE_NUMBER
DoCmd.OpenForm "frmCaseHearingView", acNormal
Forms!frmCaseHearingView.Filter = stFilter
Forms!frmCaseHearingView.FilterOn = True


You should be able to kinda combine this in one operation - not sure of the number of commas, check it:

Dim strCN as string
CN = me!Case_number
DoCmd.OpenForm "frmCaseHearingView", , , "CaseNumber =' & strCN & "'"

This is basically the same kind of code that the command button wizard writes when you use it to "open a form and find a specific record".

Jim How many of you believe in telekinesis? Raise my hand...
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top