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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

findrecord

Status
Not open for further replies.

qlark

Programmer
Jan 5, 2006
54
CA
This may be a lame question ... I am having a major block with this command because I don't follow;
- first how to determine what object/table this command is seeking from
- second how to determine what field it is supposed to search.

Given a Form with a combo box combined with a subform which is a datalist of a table ... Assuming the Primary index of this table is in the combo box. I have seen examples where the combo box value is passed to the subform with a simple

docmd.findrecord strComboBox.Value

Can someone please explain this hocus pocus
 
explain or display?

Private Sub ComboBox_AfterUpdate()

Me.sfrmName.SetFocus
Me.sfrmName.Form!pkID.SetFocus
Docmd.findRecord ComboBox

End sub
 
ok so if I read this code correctly;

Me.sfrmName.Setfocus

brings the subform in focus (is this required considering focus is being given to an absolute field on the subform in the next statement?)

me.sfrmName.form!pkid.setfocus

I assume this is the field we are attempting to seek with the current value of the combo box?

So the Docmd must be using the current object and matching the field in focus with the value passed into findrecord?
 
Absolutely!

and yes, you must set focus, in a hierarchal fashion.
start from current focus, and work down.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top