Navigation problem

Drunkenneo

Registered User.
Local time
Today, 14:03
Joined
Jun 4, 2013
Messages
192
I have made a contact form where particular member credentials are coming in text boxes, i have kept a combo box also on the top to view by the phone number, if the phone number is entered the credential of the member comes, and also the navigation buttons that is first, previous, next and last.

The main problem if i select phone number by combo box on the top, the navigation button do not continue from that part, even if i press next or previous it shows no records found.

Please help
 
I think you are having is Filters with the combo box.. That will filter the recordset thus no previous or next record will be found provided there is only one phone number.. If that is wrong could you show us the code you have in the ComboBox AfterUpdate event..
 
Not sure why you are looping through the entire recordset. This is the code you need..
Code:
Private Sub Combo35_AfterUpdate()
    If DCount("*", "All_Records", "contact_number = " & Me.Combo35) <> 0 Then
       [COLOR=Green] ' Find the record that matches the control.[/COLOR]
        Dim rs As DAO.Recordset
        Set rs = Me.Recordset.Clone
        rs.FindFirst "contact_number = " & Me.Combo35
        If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    Else
        Call MsgBox("No such record exists in the All_Records Table.", vbCritical, "No match found")
    End If
    Set rs = Nothing
    
Exit_cmd_Details_exp_Click:
    Exit Sub

Err_cmd_Details_exp_Click:
    MsgBox Err.Description
    Resume Exit_cmd_Details_exp_Click
End Sub
 
In the table since i am not using autonumber how can i display the recordnumber/total records as i navigate?
 
Do you mean...

Code:
If Me.RecordsetClone.RecordCount = 0 Then
   DoCmd.CancelEvent
Else
 With Me.RecordsetClone
   .MoveLast
   Me.txtPage = Me.CurrentRecord & " of " & .RecordCount & " pages"
 End With
End If

You will need an unbound control on your form named txtPage and you can add your own Navigation Buttons...
http://regina-whipp.com/blog/?p=538
 
Last edited:
Yes, that is what i mean and your code works great, only thing i want the status also shows once i navigate through the DB, means when selecting if it shows 1 of 5 then navigating next it should show 2 of 5, like wise.
 
That Code I gave yoi does just that, have you tried it?
 
That Code I gave yoi does just that, have you tried it?

Yes, I have worked with that code and it worked, but the only problem is when i press navigate button for to and fro records the record count remains unchanged.
 
Where do you have it... the code I provided and where are the buttons?
 
I hade the code in afterupdate of combo box, and buttons are at the bottom of the form
 
The code has to be in the On_Current event of the form in order for it to work.
 

Users who are viewing this thread

Back
Top Bottom