macro where statement

R

redFred

I open form2 from a button on form1. The button calls a macro that provides
a "please wait" message. I have attached a where statement to get form2 open
to the correc record. It does. However, a subform on form2 does not pull
the record associated with form2. I've checked the links as ok (form works
fine, except for this macro)

My where statement is:

[Forms]![2frmLabor]![InvNum]=[Forms]![2frmInvoice]![InvNum]

[Invoice] is form1 with the button to open form2 [Labor]. The subform of
[Labor] is a details form [frmLaborDetails].

Does anyone see what I am missing? Besides a working Access experienced
brain, I mean.


Thanks,
redFred
 
S

Steve Schapel

RedFred,

The normal syntax for the Where Condition argument would be:
[InvNum]=[Forms]![2frmInvoice]![InvNum]

I don't know whether that will make any difference or not, but give it a go.

If the Link Child Fields and Link Master Fields properties of the
subform are entered correctly, I can't think of why the subform would
not behave correctly. What is actually happening with the subform... no
data at all is shown, or incorrect data is shown?
 
R

redFred

Steve, thanks so much.

Looks like it was merely a syntax issue. Works fine with your suggested
syntax.

Life is good with you guys here. Thanks.
--
redFred


Steve Schapel said:
RedFred,

The normal syntax for the Where Condition argument would be:
[InvNum]=[Forms]![2frmInvoice]![InvNum]

I don't know whether that will make any difference or not, but give it a go.

If the Link Child Fields and Link Master Fields properties of the
subform are entered correctly, I can't think of why the subform would
not behave correctly. What is actually happening with the subform... no
data at all is shown, or incorrect data is shown?

--
Steve Schapel, Microsoft Access MVP
I open form2 from a button on form1. The button calls a macro that provides
a "please wait" message. I have attached a where statement to get form2 open
to the correc record. It does. However, a subform on form2 does not pull
the record associated with form2. I've checked the links as ok (form works
fine, except for this macro)

My where statement is:

[Forms]![2frmLabor]![InvNum]=[Forms]![2frmInvoice]![InvNum]

[Invoice] is form1 with the button to open form2 [Labor]. The subform of
[Labor] is a details form [frmLaborDetails].

Does anyone see what I am missing? Besides a working Access experienced
brain, I mean.


Thanks,
redFred
 

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