I have a filter form that I have created to filter/sort data by several ways. There are Combo boxes from which I select specific criteria with related command buttons to open the display form and show the records. On this form I also have from - to date controls in which to enter the From - To date range that I want to be able to better filter the records. So, I select the criteria that I want to filter by from one of the combo boxes and then enter the date range in the From-To date controls and then click on the command button next to the combo box and the display form should open and display only the records in that specified date range. In the one app if I want to see all records for a specific date range I can enter the date criteria in the From-To controls and click the Command button and see only the records for that specific date range. However, that is not what is happening with two of the filter forms in the forms in question. I have this set up on other filter forms and it works as expected. But, I can't seem to figure out why the same code with the form name changed will not work in the two filter forms which are identical to the ones in which it does work.
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is the code for the form that does not work:
Private Sub cmdActionDate_Click()
On Error GoTo Err_cmdActionDate_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmApptRec"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdActionDate_Click:
Exit Sub
Err_cmdActionDate_Click:
MsgBox Err.Description
Resume Exit_cmdActionDate_Click
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
And here is the code for the one that does from the other app. with a different form name.
Private Sub cmdActionDate_Click()
On Error GoTo Err_cmdActionDate_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmCheckRegister"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdActionDate_Click:
Exit Sub
Err_cmdActionDate_Click:
MsgBox Err.Description
Resume Exit_cmdActionDate_Click
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The last one is from a different app, and I have spent days trying to figure out why one works and the other doesn't. Perhaps there is another way to get the results I need, but, this has worked before. I am always open to learning new things, but, I don't know of another way to do it.
Any assistance would be very much appreciated.
Jan
