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

Browse through entrys

Status
Not open for further replies.

ItIsHardToProgram

Technical User
Mar 28, 2006
946
CA
Hi every one, I have a form that has contacts in them and I have added a "search" button, the default access one.

When you select a certain txtbox, it will search through that row, and not the others.

What I tried doing is that before the search fires, it opens a form, which asks 3 possibilites of rows to search in, once selected, it sets focus on that txtbox and then fires the search.

Apparantly, when I do so and the search fires, the only thing that happens is that in the search options I can't even select a row... I used
Forms![form name]![control name].setfocus

Any one knows why? or did any one try to do the same kind of function?
 
When referencing From Object to object
I found you must start at top object hierarchy;
Private Sub cmdSearch_Click()
....
Forms!frmCountry.SetFocus
Forms!frmCountry!txtCity.setFocus
....
End Sub

To reference a control on a subform on FormA, from FormB...
Forms!frmCountry.SetFocus
Forms!frmCountry!sfrmCity.setFocus
Forms!frmCountry!sfrmCity.Form!txtCity.setFocus
etc...



or look into the selectObject Method.
Still you will have to start from top object, I believe
 
I did not have any problem through the referencing....

By the way, the selectobject method only applys to Database objects,

acDataAccessPage
acDiagram
acForm
acMacro
acModule
acQuery
acReport
acServerView
acStoredProcedure
acTable

any other ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top