Alternative to List Box and Query

MatthewB

Member
Local time
Yesterday, 23:25
Joined
Mar 30, 2022
Messages
85
I am developing a contractor contacts database. These contractors are a table of people who fit a ServiceCategoru, like a plumber, or a landscaper. Its all housing based. Recently I learned about List Box and how to display fields in a query. I also learned how to select from the list and display the record in a form. But the record in the form cannot be edited in the form (methinks). What is an alternative approach to achieving this result? Ultimately I want to included ways to navigate the ServiceCategory with a 'search' function.

Thanks
 
Why cannot record be edited in form?
 
Why cannot record be edited in form?
I am not sure at this stage of my learning. The list box displays a query result. I use an OnClick script such as txt_Contractors.ServiceCategory = lst_ContQuery.column(1) to set the form record field. I data does not appear to be live to change.
 
I will look at this method.
It's very easy!
Code:
Private Sub YourListBoxName_AfterUpdate()
Dim sFilter As String
    
    If Me.YourListBoxName.ListIndex > -1 Then 'Value Selected
        sFilter = "[ServiceCategory] = " & Me.YourListBoxName
    End If

    If Len(sFilter) > 0 Then
        Me.Filter = sFilter
        Me.FilterOn = True
    Else
        Me.Filter = ""
        Me.FilterOn = False
    End If
End Sub
 
you can use this "filter" on continuous form.
 

Attachments

Users who are viewing this thread

Back
Top Bottom