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

show record from subform to form, please help!!!

Status
Not open for further replies.

fule12

Programmer
Nov 12, 2001
140
YU
I make forms Orders, based on 2 tables (Vessel and Orders) where in header of forms I have combo box (VesselId),in details section of form is field from Order table,in subform is all Orders for Vessel what is choosen from Combo box in heared of form, so when user select Vessel from combo box, in details of form is Order Form,he enter data in fields and ect,ect .The subform(datashet) show all records(orders) for that Vessel.Now my question is :"how to make when user click on record in subfom same record show in form?
I come on idea to make combo box in footer of Order form by wizard, but combo box is give list of all records.Anybody have maybe beter idea??
Thanks
Fule
 
me.txtMainFormTextBox=me.subFormName.form!NeededControlName

Aivars
 
Hi Aivars for re-play , but wher to inser code? Fule
 
You can use it as textbox control source.
txtMainFormTextBox is textbox on main form. Write in the control source box of properties window of textbox:
=subFormName.form!NeededControlName

Other way:

Write the code in the subform Current procedure:
private sub form_current()
forms!MainFormName!txtMainFormTextBox = me.NeededControlName
end sub


Note: You may create Unbound textbox for using second method!!!

Aivars
 
Aivars,

I have put the code where you told "us" to. But in the textbox I've created there appears only the value of the tuple I have assigned to it. And the rest of the field on the mainForm do not change.

So what am I doing wrong?

What I've done is put the code in a sub in the onCurrent event of the subform. Made a new textbox on the mainForm.
I have changed the names in your code to the names appropriate for my db.

Grts,

Thijs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top