macro where statement

  • Thread starter Thread starter redFred
  • Start date Start date
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
 
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, 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
 
Back
Top