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

Subform control name

Status
Not open for further replies.

SeeJane

Technical User
Jun 5, 2002
67
US
Hi all,

I'm working on a "find" button for a form with several tabbed subforms. What I'm trying to do is pick up the name of previous control and form so that when my little "Find" form opens, the previous control defaults as the field to search from the combo box cboField (all the other controls on the form are options in the combo box). The previous control sets the value of cboField, while the list of controls supply the row source. A textbox lists the name of the form being searched (Main for mainform, each subform is listed as a "category"). For simplicity's sake, the find button is on the main form.

I'm using
Screen.PreviousControl.Name (to get the control)
Screen.ActiveForm.Name (to get the form)

This works perfectly on the Main form, but is another story with the subforms. The Previous control turns up as the name of the subform, and the Active form as the Main form.

Is there a better way??

Thanks a ton,
CJ

 
Thanks for the suggestion. It haddn't occurred to me - worth a few experiments!

Cj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top