Solved

Unbound Object seems to "requery and makes data entry cumbersome

Posted on 2013-07-01
2
421 Views
Last Modified: 2013-07-02
I have an ubound object I use to Incrementally search as I enter data.

The code I use is shown below. As I type in a number the cursor jumps back to the beginning of the field.

Anybody have an idea what could cause this strange behavior?

Private Sub PcoNoSearch_Change()
    Dim PcoSearchFilter As String, PcoSearchTxtVal As Double
    If Not IsNull(Me![PcoNoSearch].Text) And Me![PcoNoSearch].Text <> "*.*" Then
            PcoSearchFilter = "[ChngPropNo] like " & """" & "*" & Me![PcoNoSearch].Text & "*" & """" & " And " & "[ContractId] = " & """" & Me![CurCntrId] & """"
        Else
            PcoSearchFilter = ""
    End If
   
    Forms![0_masterdatafrm]![01_WkgChngProposalSimpleFrm].Form.Filter = PcoSearchFilter
    Forms![0_masterdatafrm]![01_WkgChngProposalSimpleFrm].Form.FilterOn = -1
End Sub
0
Comment
Question by:rogerdjr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39292045
test this


Private Sub PcoNoSearch_Change()
    Dim PcoSearchFilter As String, PcoSearchTxtVal As Double, str
    str = str & Me.[PcoNoSearch].Text
'    If Not IsNull(Me![PcoNoSearch].Text) And Me![PcoNoSearch].Text <> "*.*" Then
'            PcoSearchFilter = "[ChngPropNo] like " & """" & "*" & Me![PcoNoSearch].Text & "*" & """" & " And " & "[ContractId] = " & """" & Me![CurCntrId] & """"
'        Else
'            PcoSearchFilter = ""
'    End If

     PcoSearchFilter = "[ChngPropNo] Like '*" & str & "*' And [ContractId] = " & Me.[CurCntrId]
   
   'if [ContractId] is Text Data, use below
   '  PcoSearchFilter = "[ChngPropNo] Like '*" & str & "*' And [ContractId] = '" & Me.[CurCntrId] & "'"
   
   
    Forms![0_masterdatafrm]![01_WkgChngProposalSimpleFrm].Form.Filter = PcoSearchFilter
    Forms![0_masterdatafrm]![01_WkgChngProposalSimpleFrm].Form.FilterOn = -1
End Sub
0
 

Author Closing Comment

by:rogerdjr
ID: 39295531
This is the code I ended up with

Thanks

-------------------
Private Sub PcoNoSearch_Change()
    Dim PcoSearchFilter As String, PcoSearchTxtVal As Double
    If Not IsNull(Me![PcoNoSearch].Text) And Me![PcoNoSearch].Text <> "*.*" Then
            PcoSearchFilter = "[ChngPropNo] like " & """" & "*" & Me![PcoNoSearch].Text & "*" & """" & " And " & "[ContractId] = " & """" & Me![CurCntrId] & """"
        Else
            PcoSearchFilter = ""
    End If

    Forms![0_masterdatafrm]![01_WkgChngProposalSimpleFrm].Form.Filter = PcoSearchFilter
    Forms![0_masterdatafrm]![01_WkgChngProposalSimpleFrm].Form.FilterOn = -1
   
    SendKeys "{end}"

End Sub
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question