Cant find subForm

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
 
T

Tom van Stiphout

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
 
T

Tom van Stiphout

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
 
B

Bob Vance

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
 

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

Similar Threads

Form Load problem 2
Open Form addition 1
Ok This one is Tuff 3
One Control for 2 codes 1
Field Size Dilemma 12
Select Stament 2
Using a Check Box as a Condition 4
Referencing to a control on a subform 1

Top