Referencing an item on a subform

  • Thread starter Thread starter Dr. Brad
  • Start date Start date
D

Dr. Brad

Good morning,
I use Windows 2000 and access 2000. I have a form called "frmDaily Job
Report," on this form is a subform called "frmInventory" which has a
control called "Item."

I want to put a constant in the control. I use an event procedure (on got
focus) and I start the coding as follows:
Forms![frmDaily Job Report]![frmInventory].Form![frmInventory].[Item] =
ItemDescription.

ItemDescription is my constant.

This does not work! Any suggestions??

Brad
 
Is the name of the control on the main form in which the subform resides
also frmInventory? Access defaults to the same name as the subform when you
drag a form onto another form, but if you dragged a Subform control from the
Toolbox onto the form, it'll be named something like "Child0"

What you want is:

Forms![frmDaily Job Report]![SubformControlName].Form![Item] =
ItemDescription

or

Me![SubformControlName].Form![Item] = ItemDescription

http://www.mvps.org/access/forms/frm0031.htm at "The Access Web" is a good
resource on this topic.
 
Thanks Douglas, I will give it a try.
Brad
Douglas J. Steele said:
Is the name of the control on the main form in which the subform resides
also frmInventory? Access defaults to the same name as the subform when you
drag a form onto another form, but if you dragged a Subform control from the
Toolbox onto the form, it'll be named something like "Child0"

What you want is:

Forms![frmDaily Job Report]![SubformControlName].Form![Item] =
ItemDescription

or

Me![SubformControlName].Form![Item] = ItemDescription

http://www.mvps.org/access/forms/frm0031.htm at "The Access Web" is a good
resource on this topic.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Dr. Brad said:
Good morning,
I use Windows 2000 and access 2000. I have a form called "frmDaily Job
Report," on this form is a subform called "frmInventory" which has a
control called "Item."

I want to put a constant in the control. I use an event procedure (on got
focus) and I start the coding as follows:
Forms![frmDaily Job Report]![frmInventory].Form![frmInventory].[Item] =
ItemDescription.

ItemDescription is my constant.

This does not work! Any suggestions??

Brad
 

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

Back
Top