S
Steve Schapel
Jan
Ok, thanks for the further information. I think I understand now. So
you need to be relating to the Record Source of the Record Form, and not
the form that the code is running on, somehting like this...
With Forms!frmCheckRegister
Select Case Me.YourOptionGroup
Case 1
.RecordSource = "SELECT * FROM YourQuery WHERE txtCheckNo Not
Like 'DBT*'"
Case 2
.RecordSource = "SELECT * FROM YourQuery WHERE txtCheckNo Like
'DBT*'"
Case 3
.RecordSource = "YourQuery"
End Select
End With
I don't remember ever seeing a system like you are using. If it was
mine, I am pretty sure I would take all the stuff you have on the Filter
Form, and put it instead in the Form Header of the Record Form.
--
Steve Schapel, Microsoft Access MVP
Ok, thanks for the further information. I think I understand now. So
you need to be relating to the Record Source of the Record Form, and not
the form that the code is running on, somehting like this...
With Forms!frmCheckRegister
Select Case Me.YourOptionGroup
Case 1
.RecordSource = "SELECT * FROM YourQuery WHERE txtCheckNo Not
Like 'DBT*'"
Case 2
.RecordSource = "SELECT * FROM YourQuery WHERE txtCheckNo Like
'DBT*'"
Case 3
.RecordSource = "YourQuery"
End Select
End With
I don't remember ever seeing a system like you are using. If it was
mine, I am pretty sure I would take all the stuff you have on the Filter
Form, and put it instead in the Form Header of the Record Form.
--
Steve Schapel, Microsoft Access MVP
Jan said:Hi Steve
The Record Form is a form on which the selected data is displayed after is
has been sorted/specified on the Filter Form. The Filter Form is the form
where there's a series of combo boxes that have a list of data to select
from, such as, Transactions, Transaction types, etc., and associated command
buttons with code that calls the Record form to open and display only the
specific record information selected from the Filter Form controls. Such
as; if I select Auto Expense from the list of Transaction types in a combo
box on the Filter Form, then click the command button next to it, the Record
Form is then opened only displaying all of the Auto Expenses entered.
The Record Form does nothing but display the data called from the activities
that takes place on the Filter form. Example: here's the code behind one
of the command buttons for one of the combo boxes on the Filter Form:
Private Sub cmdCheckNo_Click()
On Error GoTo Err_cmdCheckNo_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmCheckRegister"
stLinkCriteria = "[CheckNo]=" & "'" & Me![cmbCheckNo] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdCheckNo_Click:
Exit Sub
Err_cmdCheckNo_Click:
MsgBox Err.Description
Resume Exit_cmdCheckNo_Click
End Sub
Hopefully, this will help clarify what type of form I mean by 'Filter Form.'
I have seen such filtering/sorting forms in various posts in the ng's called
by many different terms or names (driver form, for one), but, I am not
familiar with any one particular term for this kind of form. However, if
there is a specific name for it, please let me know and I'll be very happy
to use it in order to eliminate confusion for others as well. I just call
it a Filter Form because...... well.... that's what it does. )
However, the method we have been discussing assumes that the Option
Group is on the form that is displaying the records that you are
manipulating. If, for some reason, you want the buttons to be on one
form, and manipulate the records shown on another form, well... this
would be unusual, but is certainly possible.
If possible, I would like to keep all the record sorting activities on the
sorting form (Filter Form), so that there will only be the specific data
records displayed on the Record Form, and no other activities required other
than scrolling to review the information. All the users need to do is
review the information, they don't need to do anything with it.
I really do like the look and function of the Option Group, and I'm sure
this will work adequately, if there is a way to code it so that when you
click one of the buttons, the Record Form opens, and just the data for that
button is displayed. As there are only these 3 functions necessary for this
purpose, this would be a very quick and simple way to handle the sorting.
However, is this type of function possible using the Option Group?
Thank you so much for your time and patience, Steve, it's very much
appreciated.
Jan