Cant find subForm

  • Thread starter Thread starter Bob Vance
  • Start date Start date
B

Bob Vance

I dont think my code can find this list Box lstModify , I am getting this
error and this part of the code in yellowed!
frmMain is open when I make the selection from a list box on it.
Syntax Error (Missing Operator) in query expression "InvoiceID="

recInvoice.Open "SELECT * FROM tblInvoice where InvoiceID=" &
Forms!frmMain!subfrmModifyInvoiceClient!lstModify.value _
, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
 
On Tue, 23 Feb 2010 12:24:48 +1300, "Bob Vance" <[email protected]>
wrote:

That should be:
Forms!frmMain!subfrmModifyInvoiceClient.Form!lstModify.value

-Tom.
Microsoft Access MVP
 
My point exactly.
The way I think about it is this:
Forms: the collection of open mainforms.
frmMain: my form.
subfrmModifyInvoiceClient: the subform CONTROL on my form.
Form: step into that subform. You're now in a form again.
lstModify: the control on the subform.
value: the property to access.

-Tom.
Microsoft Access MVP
 
Thanks tom, worked perfect :) regards Bob

Tom van Stiphout said:
My point exactly.
The way I think about it is this:
Forms: the collection of open mainforms.
frmMain: my form.
subfrmModifyInvoiceClient: the subform CONTROL on my form.
Form: step into that subform. You're now in a form again.
lstModify: the control on the subform.
value: the property to access.

-Tom.
Microsoft Access MVP
 
Back
Top