putting what is selected from an unbound combobox from main to sub

G

Guest

I am getting the below error

Invalid reference to the parent property


Me!Job = Parent.cbojoblocautonum.Column(1)


I am trying to automatically fill in the job(number) in the subform based
off of what is selected in the combo box(and unbound control) of the main
form - the job number is
the second field in the combo box on the main form and based on the
selection want that value put into the subform.

I am sure sytax is wrong somewhere - just not sure where??

Thanks,
Barb




The combo box of jobsloacautonum is actually an unbound combo box the
only
thing bound on the main form is the date. Would like to keep it unbound
since everything pretty much working just need to know how to reference it to
get the job automatically put into the subform job field.






Thanks again,
Barb
 
J

John W. Vinson

I am getting the below error

Invalid reference to the parent property


Me!Job = Parent.cbojoblocautonum.Column(1)


I am trying to automatically fill in the job(number) in the subform based
off of what is selected in the combo box(and unbound control) of the main
form - the job number is
the second field in the combo box on the main form and based on the
selection want that value put into the subform.

Rather than filling it in with code, why not use the Subform's Master Link
Field property? Be sure that the bound column of cboJobLocAutonum is the
correct column (note that Column(1) is the *SECOND* column, it's zero based,
but that the bound column is 1-based - it's confusing!!)

If that's set correctly, you can set the Master Link Field to

[cbojoblocautonum]

and the child link field to [Job].

John W. Vinson [MVP]
 
G

Guest

Job and joblocautonum are 2 different fields. There is a table for
jobs(listed one time) - jobs primary key in this table and then a table with
an autonumber joblocautonum - the primary key in this table. also in the
jobs at location table is location, room, job (job here is a many) the same
job can be done at many locations. When I pick the joblocautonum in the main
form the drop downlist include the location, room, job,esttime(to do the
job). I want to grab the job selected(already am getting the joblocautonum
put in the subform) in the joblocautonum drop downlist and have it
automatically put into the subform.

Please let me know if you need anymore clarity
Thanks so much John,
Barb

John W. Vinson said:
I am getting the below error

Invalid reference to the parent property


Me!Job = Parent.cbojoblocautonum.Column(1)


I am trying to automatically fill in the job(number) in the subform based
off of what is selected in the combo box(and unbound control) of the main
form - the job number is
the second field in the combo box on the main form and based on the
selection want that value put into the subform.

Rather than filling it in with code, why not use the Subform's Master Link
Field property? Be sure that the bound column of cboJobLocAutonum is the
correct column (note that Column(1) is the *SECOND* column, it's zero based,
but that the bound column is 1-based - it's confusing!!)

If that's set correctly, you can set the Master Link Field to

[cbojoblocautonum]

and the child link field to [Job].

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top