Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box search bombing out

Status
Not open for further replies.

zevw

MIS
Jul 3, 2001
697
US
I am working on this for hours and do not know where to go with it

This code works fine, I select from the combo box the customers name and I takes me to that customer
Code:
Private Sub FindName_AfterUpdate()
    If Not IsNull(Me.FindName) And Me.FindName <> "" Then
        Me.FindPhone = ""
        Me.FindCode = ""
        Me.FindContact = ""
        Me.RecordsetClone.FindFirst "[CustId] = " & Me![FindName]
        Me.Bookmark = Me.RecordsetClone.Bookmark
    Else
        DoCmd.ShowAllRecords
    End If
End Sub

This is combo box where I search by telephone number when I click on the telephone number that I am looking for it just throws me out of Access.

Code:
Private Sub FindPhone_AfterUpdate()
    If Not IsNull(Me.FindPhone) And Me.FindPhone <> "" Then
        Me.FindName = ""
        Me.FindCode = ""
        Me.FindContact = ""
        Me.RecordsetClone.FindFirst "[CustId] = " & Me![FindPhone]
        Me.Bookmark = Me.RecordsetClone.Bookmark
    Else
        DoCmd.ShowAllRecords
    End If
End Sub

What makes it even more complicated is, that if I run the program on my home computer it works fine in any dropdown and will not bomb out. In the office however is where I have the problem.

Both machines are XP Professional
My machine has Access 2003
The Office has Access 2002

I compiled both program and no error, tried shuffling around my references it still bombs me out. What can I do for a next step to get to the core of this problem?

I thank you for any help in advance!
 
i know it works but, aren't phone numbers usually text data type?
[CustId] is searched on by using both, FindPhone & FindName?
 
The CustId is the first column in the combo box which is a number field, and is set to 0 in., the phone number is being displayed. The Cust. ID is the field that it searches for.

In any case I really appreciate your help, I think I found the problem is with the query behind the combo box. Why it works on 1 machine and the other not, that I still do not understand? However I changed a IIf function in the query and it works now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top