The WHERE 1=1 does work now, but not the way I thought it would. It
does not open to the selected record clicked on but rather the first
record in the filter. This is not what I wanted.
The query is in a subform which is filtered by the main form (unbound)
The user can open a single record (in theory by clicking on that
section of the query shown in the subform) with the code below:
Sub subOpenAddingDataForm()
DoCmd.OpenForm "frmAddingData", , , "Violator_ID =" & Violator_ID
Form_frmAddingData.Caption = "Edit Data"
Form_frmAddingData.AllowEdits = False
Form_frmAddingData.AllowAdditions = False
Form_frmAddingData.AllowFilters = False
Form_frmAddingData.AllowDeletions = False
End Sub
Private Sub Violator_ID_DblClick(Cancel As Integer)
Call subOpenAddingDataForm
End Sub
Private Sub Violation_ID_DblClick(Cancel As Integer)
Call subOpenAddingDataForm
End Sub
Private Sub DateEntered_DblClick(Cancel As Integer)
Call subOpenAddingDataForm
End Sub
Private Sub ViolatorsDepartmentNumber_DblClick(Cancel As Integer)
Call subOpenAddingDataForm
End Sub
Private Sub Policy_ID_DblClick(Cancel As Integer)
Call subOpenAddingDataForm
End Sub
Private Sub OriginalDocument_DblClick(Cancel As Integer)
Call subOpenAddingDataForm
End Sub
Private Sub Amount_DblClick(Cancel As Integer)
Call subOpenAddingDataForm
End Sub
Private Sub Description_DblClick(Cancel As Integer)
Call subOpenAddingDataForm
End Sub
Private Sub MissingDocumentation_DblClick(Cancel As Integer)
Call subOpenAddingDataForm
End Sub
Private Sub Preparer_ID_DblClick(Cancel As Integer)
Call subOpenAddingDataForm
End Sub
The WHERE 1=1 is not going to work, as you have already determined. Even if
it did, it would not get the form to open to the selected record.
If you can post back some detail on how the user is selecting a record,
perhaps we can recommend a solution.
:
I am getting the error:
Run time error '3075'
syntax error (missing operator in query expression 'WHERE 1=1 AND
([DateEntered]>=#01/01/2005#) AND (DateEntered] < #10/24/2006#)'
I had it working until I added the 1=1 to the Where to try to get a
form to open to the specific record in the query that the user clicked
on.
Any help is appreciated. Thanks