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

setting focus with a subform 1

Status
Not open for further replies.

kkarren

Technical User
Mar 30, 2000
33
US
I have a subform that is linked properly to a form.  I had the focus set properly to the key fields in each form.  I needed to change the order of display on the linked forms and changed the control source of the linked form to an SQL of the table allowing me to have the correct order in the subform.  I still maintain the correct parent child relationship in the subform and form but have lost the focus of the overall form.  Any ideas?
 
Not sure I follow all that.<br>But to set a subforms record source to an SQL statement is simply:<br><br>&nbsp;&nbsp;&nbsp;' set record source to Subform <br>&nbsp;&nbsp;&nbsp;dim MyRecordSource as string, Somevalue as variant<br>&nbsp;&nbsp;&nbsp;MyRecordSource = &quot;Select * From Tablename Where Yourfield = &quot; & Somevalue<br>&nbsp;&nbsp;&nbsp;Me![YOURsubform].Form.RecordSource = MyRecordSource<br>&nbsp;&nbsp;&nbsp;' Then requery it<br>&nbsp;&nbsp;&nbsp;Me![YOURsubform].requery<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top