(( FindRecord split form records from combo box ))

alhabkk

Registered User.
Local time
Today, 23:27
Joined
Sep 9, 2013
Messages
49
Gents,
I have a split form with many of a combobox (date, text,numbers and both).
How can displayed only the records in the datasheet based on a combo box selection?
Can someone explain how to build this mechanism and write a sample code?

Thanks & regards
 
more explanation in picture below
 

Attachments

  • yuiuy.PNG
    yuiuy.PNG
    86.7 KB · Views: 146
The easiest way is to use the built-in filter function! In Form View, you can Right-Click on any Field, hold the cursor over either Text Filters or Number Filters (only the one appropriate to the Field will show) then select 'Equals.' An Input Box appears and you type in the value you want (such as waiting) to Filter on.

You can do this for multiple Fields, in turn, if you want.

To remove the Filter, go to the bottom of the Form and you'll see a highlighted Icon that is titled 'Filtered.' Click on it and the Form will return to its unfiltered state.

Linq ;0)>
 
The easiest way is to use the built-in filter function! In Form View, you can Right-Click on any Field, hold the cursor over either Text Filters or Number Filters (only the one appropriate to the Field will show) then select 'Equals.' An Input Box appears and you type in the value you want (such as waiting) to Filter on.

You can do this for multiple Fields, in turn, if you want.

To remove the Filter, go to the bottom of the Form and you'll see a highlighted Icon that is titled 'Filtered.' Click on it and the Form will return to its unfiltered state.

Linq ;0)>

Linq, thank u u for help but its not what I'm looking for!
For example:
-A user want to enter new entry data (normally all boxes are blank). Once a user select "waiting" or "in progress" or "completed" in field [Status] , the data-sheet displayed only the user selected.
And its keep changing as the user selection






I hop its clear now ;-)
 
If you will follow the thread you will find out that the DB was designed from scratch based on OP's requests.
So, first I designed the tables, then the queries and VBA and, finally, the forms.
So, the forms should be in the last posts, isn't it ?
 
If you will follow the thread you will find out that the DB was designed from scratch based on OP's requests.
So, first I designed the tables, then the queries and VBA and, finally, the forms.
So, the forms should be in the last posts, isn't it ?



I didn’t see the second page. Sorry! :banghead:

I saw ur Db its little bit different from what I’m looking for.
the combo box can filter the table and also used for entry new data

my db in attach plz have look and work on it :(
 

Attachments

While missinglinq solution seems to be the best (see #3), I implemented 2 more solution.
Both are for the same control/field "Status"
The first one you can see on the yellow band.
The second one is the exact answer to your request (see the After Update event for Status) but has no logic.
 

Attachments

Last edited:
While missinglinq solution seems to be the best (see #3), I implemented 2 more solution.
Both are for the same control/field "Status"
The first one you can see on the yellow band.
The second one is the exact answer to your request (see the After Update event for Status) but has no logic.

Mihail,

First of all, thank you for your co-operation.

Regarding to solution #1 : once I select a value from the list for example “waiting” it moved to first data entered ! I hope to not move to first data entered and keep the user continue with new entry.
I need to use this method because the user can observe if somebody entered the data before because we have a huge number of staff.

For solution #2: it’s really great and I’m thinking to use it for search page.


Thanks alot
 
While missinglinq solution seems to be the best (see #3), I implemented 2 more solution.
Both are for the same control/field "Status"
The first one you can see on the yellow band.
The second one is the exact answer to your request (see the After Update event for Status) but has no logic.



Milah regarding in first solution, I tried to filter by two fields but it’s not work! can u help me plz
 
Be specific. What fields ? Are you sure that you wish only this two ? Hoe to filter (using OR or AND between conditions ?)
 
Be specific. What fields ? Are you sure that you wish only this two ? Hoe to filter (using OR or AND between conditions ?)

I created another combobox for [Location] filtering the table with wich u created before [Status]. so filter have to be in AND condition.
 
Code:
Private Sub Location_AfterUpdate()
    Call FilterForm
End Sub

Private Sub Status_AfterUpdate()
    Call FilterForm
End Sub

Private Sub FilterForm()
Dim strFilter As String
    'Construct the filter
    If Not IsNull(Me.Status) Then
        strFilter = "(Status = '" & Me.Status & "')"
    End If
    If Not IsNull(Me.Location) Then
        If strFilter <> "" Then
            strFilter = strFilter & " AND "
        End If
        strFilter = strFilter & "(Location = '" & Me.Location & "')"
    End If
    
On Error GoTo ErrorHandler
    'Applay the filter
    Me.Filter = strFilter
    Me.FilterOn = True

Ex:
Exit Sub

ErrorHandler:
    'Catch here unexpected errors
    Resume Ex
End Sub
 
Code:
Private Sub Location_AfterUpdate()
    Call FilterForm
End Sub
 
Private Sub Status_AfterUpdate()
    Call FilterForm
End Sub
 
Private Sub FilterForm()
Dim strFilter As String
    'Construct the filter
    If Not IsNull(Me.Status) Then
        strFilter = "(Status = '" & Me.Status & "')"
    End If
    If Not IsNull(Me.Location) Then
        If strFilter <> "" Then
            strFilter = strFilter & " AND "
        End If
        strFilter = strFilter & "(Location = '" & Me.Location & "')"
    End If
 
On Error GoTo ErrorHandler
    'Applay the filter
    Me.Filter = strFilter
    Me.FilterOn = True
 
Ex:
Exit Sub
 
ErrorHandler:
    'Catch here unexpected errors
    Resume Ex
End Sub

It's not work ! :banghead:
 

Attachments

You will cry again if you will copy only what you think from my code.
Have you seen the AfterUpdate routine in my code ? Where are this in your code ?
 
You will cry again if you will copy only what you think from my code.
Have you seen the AfterUpdate routine in my code ? Where are this in your code ?

I forgot to edit the combobox names :D

Its work good now. I will try to add more combobox ;)

Thanks alot Mihail
 

Users who are viewing this thread

Back
Top Bottom