Results 1 to 1 of 1
  1. #1
    Join Date
    Aug 2004

    Unanswered: help needed with coding combo boxes

    Ive got my Combo Boxes working, when i use my apply filter button, they select records from the corresmisctbl that match both selections in the comb boxes

    If I want the results to be listed inside this corresmiscform on my startup page

    Do i need to reconfig or write some code similar to what we have been using on the search buttons? declaring two strings, where each selection from the combo boxes will be stored, and then the strsql to select exactly the same fields displayed as in the search corres button function, and also the two lines about sourceobject to tell it i want the fields loaded into that form?as at the moment its trying to load the fields into the rc-plisubform design.

    I know this is probably way off but i tried and this is my code

    Private Sub apply filter_Click()

    Dim strSQL As String, strRoadID As String, strFileID As String,

    strRoadID = "cmbroad"
    strFileID = "cmbRef"
    If strRoadID = "" Then
    If strFileID = "" Then
    Exit Sub
    End If
    End If

    strSQL = "SELECT [record number], [from], [RoadID], " & _ , [FileID], " & _
    "[corresmisctbl].details, [corresmisctbl].[section/s], [corresmisctbl].[file number], [corresmisctbl].attachments " & _
    "From [corresmisctbl] WHERE [corresmisctbl].[RoadID] Like '*" & _
    strcmbroad & "*'& [corresmisctbl].[FileID] Like '*" & _
    strcmbref & "*'ORDER BY [corresmisctbl].from;"

    Me.corresmisctblsubform.SourceObject = "corresmisctblsubform"
    Me.corresmisctblsubform.Form.RecordSource = strSQL

    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts