Problem w/referencing a Sub-Form via VBA

A

Anthony Viscomi

I hav the following:

DoCmd.OpenForm "frmPayment", , , , acFormAdd, acDialog
Me![SS] = Forms![dbo_course subform].SS

I want the "frmPayment" to add the "SS" from the subform when it is opened
via a "click" event.

I've also tried this:
Me![SS] = Forms![frmStudent(Main)]![dbo_course subform]!SS

Thanks in advance!
Anthony
 
B

Bas Cost Budde

Anthony said:
I hav the following:

DoCmd.OpenForm "frmPayment", , , , acFormAdd, acDialog
Me![SS] = Forms![dbo_course subform].SS

I want the "frmPayment" to add the "SS" from the subform when it is opened
via a "click" event.

I've also tried this:
Me![SS] = Forms![frmStudent(Main)]![dbo_course subform]!SS

The general reference syntax for subform controls is this:

forms!yourformname!yoursubformCONTROLname.Form.yourcontrolnameinthesubform
 

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