Jump to record

Neimad

Registered User.
Local time
Today, 05:55
Joined
Jul 11, 2007
Messages
19
I have a drop down box displaying a list of names from the table. I want a button next to it so if needed the user can jump to that record. Is this possible?
 
use the combo box wizard to create the code to find a record for you.
 
You certainly can, put a command button on your form with the following code behind it.

DoCmd.GoToRecord , , acGoTo, Combo#

Insert your combo box name at Combo#
 
Remember this time I need the button to jump to the record when the user clicks it and not on combo box. I copy and pasted the code by replacing '

rs.FindFirst "[Agent ID] = " & Str(Nz(Me![button], 0))
with
rs.FindFirst "[Agent ID] = " & Str(Nz(Me![ParentCompany], 0))

doesnt work. I am sure thats something wrong with one part of the control but coming from C# to this is horrible.

' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Agent ID] = " & Str(Nz(Me![ParentCompany], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
 
You certainly can, put a command button on your form with the following code behind it.

DoCmd.GoToRecord , , acGoTo, Combo#

Insert your combo box name at Combo#

Doesnt work :confused: What does the # represent?
 
My method will do exactly as you wish. The comboBox must be unbound and it must return a numeric value that corresponds to a recordID or similar on the record you wish to jump to.
 
Doesnt work :confused: What does the # represent?

Combo# Represents the name of your Combo Box. Replace the whole of the highlighted phrase with your ComboBox name. I simply used # to represent any number.
 
My method will do exactly as you wish. The comboBox must be unbound and it must return a numeric value that corresponds to a recordID or similar on the record you wish to jump to.

Ah the combo box is bound. It needs to contain the data on which company is head of that company. Hence the jump to record but only when needed.
 

Users who are viewing this thread

Back
Top Bottom