Subform Search (1 Viewer)

tucker61

Registered User.
Local time
Yesterday, 16:11
Joined
Jan 13, 2008
Messages
321
I have a search button on mymain form, and Somewhere along the line the search has stopped working. Here is my code on the search button.

Sub form data is in the tblqcintakedetail table.
Main form data is in the tblqcintake table.


Code:
Private Sub Search_By_Line_Click()
Dim line As String
      AttemptSave
    line = InputBox("Enter Line Number . . . ", "Search Line")
    If Len(line) > 0 Then
        Me.RecordSource = "SELECT * FROM tblQCIntakedetail WHERE tblQCIntakedetail.cat_no='" & Trim(UCase(Nz(line, ""))) & "' ORDER BY Input_Date DESC;"
        Forms!frmintake.Requery
    End If
    End Sub
 

Ranman256

Well-known member
Local time
Yesterday, 19:11
Joined
Apr 9, 2015
Messages
4,339
You could just run a query,instead of using SQL.
The query would use the key in the parent.
 

Users who are viewing this thread

Top Bottom