Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Unbound Object seems to "requery and makes data entry cumbersome

Posted on 2013-07-01
2
Medium Priority
?
433 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 2000 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

722 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