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!

Autofill 4 text/combo boxes in subform

Status
Not open for further replies.

Garn0410

Technical User
Nov 16, 2004
2
GB
Hi,

Im relatively new to Access, but have a database that is nearing completion. I have a subform on a front page that I want to autofill.

Basically the subform "Affected" contains the primary combo box (Reference) that I will use to select a value and prompt the other three combo/text boxes to autofill. Also within the "Affected" form is the other combo box (Type) that I want to Autofill. On top of this, within "Affected" there is a subform "Affected Subform" that contains the two text boxes (Name and Descripion).

All the data is stored in columns within a query. However the form "Affected" records other data and the end result that I want to occur is for the Reference information, 3 autofilled boxes and other supplementary information to be recorded in the one table "Affected Table".

So in Summary I will select a value from "Reference", it will then autofill the combo box on the form, and two text boxes in the "Affected subform". The information is all stored in "index Query" but I want it then recorded with other information in the "affected Table".

I have tried me.text0 = Me.Reference.Column(0) type comments to no avail. Can anyone help me please!!!!!!!!!!!
 
Hi

"I have tried me.text0 = Me.Reference.Column(0) type comments to no avail."

Any Error messages?

Obviously from your code above you understand the principle of having a multi column combo box, and the ability to address the "other" columns via the .column property

This is the way to go I believe

I suspect your problem may be because you are trying to address controls from the subfrom which are on the main form

so if you the control is on the sub form and you want to set it to the value of a combo on teh main form try:

=Forms!MyMainForm!Reference.Column(0)

using the correct form name in plave of MyMainForm

If you are on the main form and you want to address a control on the sub form, you must make use of the .FORM property of the subform control, they syntax is

Me.MySubFormControl.FORM.MyControl

In you case you have a nested sub form, ie a sub form, which itself contains a sub form so I would expect that to address a control on the sub sub form from the main form the syntax would be

Me.MySubFormControl.FORM.MySubSubFormControl.FORM.MyControl

(not sure about the latter, I have not tried it!)

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hey thanks KenReay,

To be honest my knowledge of multi-column combo boxes and addressing other column via the .column property is poor, if you could explain it more it would make life a lot easier as at this stage I'm operating with bit s of information and not the overall picture.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top