I have a combo box with the following code and I get an error "You have canceled the previous operation" and I don't understand why. Can someone please help?
'I/O lookup
Private Sub List20_AfterUpdate()
' Find the record that matches the control.
Dim strSQLSF As String
List21 = Null
strSQL = "SELECT DISTINCT qryafehdr2.[Name] FROM qryafehdr2 "
strSQL = strSQL & " WHERE qryafehdr2.[Internal Order Number] = '" & List20 & "'"
strSQL = strSQL & " ORDER BY qryafehdr2.[Name];"
List21.RowSource = strSQL
strSQLSF = "SELECT * FROM qryafehdr2 "
strSQLSF = strSQLSF & " WHERE qryafehdr2.[Internal Order Number] = '" & List20 & "'"
Forms![Executive Look-Up Form]![Invoice_Header_Total_Exec subform1].LinkChildFields = "Internal Order Number"
Forms![Executive Look-Up Form]![Invoice_Header_Total_Exec subform1].LinkMasterFields = "Internal Order Number"
Me.RecordSource = strSQLSF
Me.Requery
End Sub
liltechy
'I/O lookup
Private Sub List20_AfterUpdate()
' Find the record that matches the control.
Dim strSQLSF As String
List21 = Null
strSQL = "SELECT DISTINCT qryafehdr2.[Name] FROM qryafehdr2 "
strSQL = strSQL & " WHERE qryafehdr2.[Internal Order Number] = '" & List20 & "'"
strSQL = strSQL & " ORDER BY qryafehdr2.[Name];"
List21.RowSource = strSQL
strSQLSF = "SELECT * FROM qryafehdr2 "
strSQLSF = strSQLSF & " WHERE qryafehdr2.[Internal Order Number] = '" & List20 & "'"
Forms![Executive Look-Up Form]![Invoice_Header_Total_Exec subform1].LinkChildFields = "Internal Order Number"
Forms![Executive Look-Up Form]![Invoice_Header_Total_Exec subform1].LinkMasterFields = "Internal Order Number"
Me.RecordSource = strSQLSF
Me.Requery
End Sub
liltechy