Contact not opening on correct id (1 Viewer)

jnvcdfhj

Registered User.
Local time
Today, 05:05
Joined
Aug 1, 2019
Messages
11
Hi all,

I have a customers form and each new customer is given a contact id which starts from 18 and goes up to around 700. The contact id is displayed on the form but cannot be edited or removed to navigate to another record.
In order to flick from record to record i have a quick find drop down which displays all contact names and when selecting the one required will change to that record.

I have noticed on selecting certain records i will select the contact name i require but it will display contact id number 18 on the customers record, i have checked the be of the db and the correct information is there but is not displayed. This only happens on a few records though and there is not a pattern to those records?

Any help would be appreciated.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:05
Joined
May 21, 2018
Messages
8,588
Can you provide the navigation code?
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:05
Joined
Sep 21, 2011
Messages
14,434
I'd start by walking through the code in the debugger with F8 and inspect the variables.?
 

jnvcdfhj

Registered User.
Local time
Today, 05:05
Joined
Aug 1, 2019
Messages
11
Hi,

Please find attached.
 

Attachments

  • Screen Shot 2019-08-27 at 12.35.27.png
    Screen Shot 2019-08-27 at 12.35.27.png
    87.7 KB · Views: 49

Dreamweaver

Well-known member
Local time
Today, 13:05
Joined
Nov 28, 2005
Messages
2,466
Your converting it to a string but checking for a long


"[ContactID] ='" & Me![Combo439] & "'"
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:05
Joined
May 7, 2009
Messages
19,246
contactID is a number, right (post #1)

.Findfirst "[ContactID] = " & Nz(Me![combo439], 0)
 

jnvcdfhj

Registered User.
Local time
Today, 05:05
Joined
Aug 1, 2019
Messages
11
I have the following error.
 

Attachments

  • Screen Shot 2019-08-27 at 15.42.27.png
    Screen Shot 2019-08-27 at 15.42.27.png
    95.7 KB · Views: 45

Gasman

Enthusiastic Amateur
Local time
Today, 13:05
Joined
Sep 21, 2011
Messages
14,434
Why have you put that code there?:banghead:

It is meant to go in place of your other FindFirst.
 

Dreamweaver

Well-known member
Local time
Today, 13:05
Joined
Nov 28, 2005
Messages
2,466
Maybe he should use the wizard to create a combo search
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:05
Joined
May 7, 2009
Messages
19,246
Code:
Private Sub Combo439_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
With rs
    .FindFirst "[ContactID] = " & Nz(Me![combo439], 0) 
    If Not .NoMatch Then
        Me.Bookmark = .Bookmark
    End If
End With
Set rs = Nothing
End Sub
 

jnvcdfhj

Registered User.
Local time
Today, 05:05
Joined
Aug 1, 2019
Messages
11
I have tried all the code you have provided and neither is working.

This one .Findfirst "[ContactID] = " & Nz(Me![combo439], 0)

No longer takes me to the first record ever entered on to my db but just remains on the current record i was viewing.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:05
Joined
Feb 19, 2002
Messages
43,466
put a stop on the FindFirst line of code and print the value of the Nz() expression to see what you get.
 

Users who are viewing this thread

Top Bottom