I have a form with unbound controls that filter the details portion of the continuous form based on what is entered or selected in these unbound controls. I am having a couple issues with the form in regards to my text boxes and their onchange event. When you type in one of the text boxes to filter the data as you type I am unable to type a space. It just will not let me. On the same level if I enter something that comes back with no records the cursor wont stay at the end of the text. It highlights all the text. Not sure how to fix these issues and have been trying for a couple days now. Below is my code.
Me.Requery
stLinkCriteria = ""
If Not IsNull(Me.BugNumber) Or Not IsNull(Me.Product) Or Not IsNull
(Me.Importance) Or Not IsNull(Me.Status) Or Not IsNull
(Me.Resolution) Or Not IsNull(Me.AssignedTo) Or Not IsNull
(Me.Title) Or Not IsNull(Me.Build) Then
If Not IsNull(Me.BugNumber) Then
If stLinkCriteria = "" Then
stLinkCriteria = "Where IDBug like ""*" & Me.BugNumber & "*"""
Else
stLinkCriteria = stLinkCriteria & "and IDBug like ""*" &
Me.BugNumber & "*"""
End If
End If
If Not IsNull(Me.Product) Then
If stLinkCriteria = "" Then
If Me.Product = "NULL" Then
stLinkCriteria = "Where Product Is Null or Product =''"
Else
stLinkCriteria = "Where Product like ""*" & Me.Product &
"*"""
End If
Else
If Me.Product = "NULL" Then
stLinkCriteria = stLinkCriteria & "and Product =''"
Else
stLinkCriteria = stLinkCriteria & "and Product like ""*" &
Me.Product & "*"""
End If
End If
End If
If Not IsNull(Me.Importance) Then
If stLinkCriteria = "" Then
If Me.Importance = "NULL" Then
stLinkCriteria = "Where Risk =''"
Else
stLinkCriteria = "Where Risk like ""*" & Me.Importance &
"*"""
End If
Else
If Me.Importance = "NULL" Then
stLinkCriteria = stLinkCriteria & "and Risk =''"
Else
stLinkCriteria = stLinkCriteria & "and Risk like ""*" &
Me.Importance & "*"""
End If
End If
End If
If Not IsNull(Me.Status) Then
If stLinkCriteria = "" Then
If Me.Status = "NULL" Then
stLinkCriteria = "Where Status =''"
Else
stLinkCriteria = "Where Status like ""*" & Me.Status & "*"""
End If
Else
If Me.Status = "NULL" Then
stLinkCriteria = stLinkCriteria & "and Status =''"
Else
stLinkCriteria = stLinkCriteria & "and Status like ""*" &
Me.Status & "*"""
End If
End If
End If
If Not IsNull(Me.Resolution) Then
If stLinkCriteria = "" Then
If Me.Resolution = "NULL" Then
stLinkCriteria = "Where ResolutionState =''"
Else
stLinkCriteria = "Where ResolutionState like ""*" &
Me.Resolution & "*"""
End If
Else
If Me.Resolution = "NULL" Then
stLinkCriteria = stLinkCriteria & "and ResolutionState =''"
Else
stLinkCriteria = stLinkCriteria & "and ResolutionState like
""*" & Me.Resolution & "*"""
End If
End If
End If
If Not IsNull(Me.AssignedTo) Then
If stLinkCriteria = "" Then
If Me.AssignedTo = "NULL" Then
stLinkCriteria = "Where AssignedTo Is Null or AssignedTo =
''"
Else
stLinkCriteria = "Where AssignedTo like ""*" &
Me.AssignedTo & "*"""
End If
Else
If Me.AssignedTo = "NULL" Then
stLinkCriteria = stLinkCriteria & "and (AssignedTo Is Null or
AssignedTo = '')"
Else
stLinkCriteria = stLinkCriteria & "and AssignedTo like ""*" &
Me.AssignedTo & "*"""
End If
End If
End If
If Not IsNull(Me.Title) Then
If stLinkCriteria = "" Then
If Me.Title = "NULL" Then
stLinkCriteria = "Where Title Is Null or Title = ''"
Else
stLinkCriteria = "Where Title like ""*" & Me.Title & "*"""
End If
Else
If Me.Title = "NULL" Then
stLinkCriteria = stLinkCriteria & "and (Title Is Null or Title = '')"
Else
stLinkCriteria = stLinkCriteria & "and Title like ""*" & Me.Title &
"*"""
End If
End If
End If
If Not IsNull(Me.TestNum) Then
If stLinkCriteria = "" Then
If Me.TestNum = "NULL" Then
stLinkCriteria = "Where TestNumber Is Null or TestNumber =
''"
Else
stLinkCriteria = "Where TestNumber like ""*" & Me.TestNum
& "*"""
End If
Else
If Me.TestNum = "NULL" Then
stLinkCriteria = stLinkCriteria & "and (TestNumber Is Null or
TestNumber = '')"
Else
stLinkCriteria = stLinkCriteria & "and TestNumber like ""*" &
Me.TestNum & "*"""
End If
End If
End If
If Not IsNull(Me.Build) Then
If stLinkCriteria = "" Then
If Me.Build = "NULL" Then
stLinkCriteria = "Where Build Is Null or Build = ''"
Else
stLinkCriteria = "Where Build like ""*" & Me.Build & "*"""
End If
Else
If Me.Build = "NULL" Then
stLinkCriteria = stLinkCriteria & "and (Build Is Null or Build =
'')"
Else
stLinkCriteria = stLinkCriteria & "and Build like ""*" &
Me.Build & "*"""
End If
End If
End If
Me.RecordSource = "Select * from qryBugSearch " & stLinkCriteria
ElseIf Not IsNull(Me.TestNum) Then
If Me.TestNum = "Null" Then
Me.RecordSource = "Select * from qryBugSearch where
TestNumber Is Null Or TestNumber = ''"
Else
Me.RecordSource = "Select * from qryBugSearch where
TestNumber like ""*" & Me.TestNum & "*"""
End If
Else
Me.RecordSource = "qryBugSearch"
End If
If Me.btnHideShowApp.Caption = "SHOW" Then
Form.Filter = "BugMain.Status <> """ & "Approved" & """ or
BugMain.Status Is Null"
Me.FilterOn = True
End If
TestNum.SetFocus
TestNum.SelStart = TestNum.SelLength