Where Statement on a subform/tab control

G

Guest

I regularly use a continuous form with a command button to allow the user to
go to more detail about a specific record. Normally, I simply do this with a
macro. However, in this case the continuous form is a subform on a tab
control and I am unable to get the correct syntax in a where condition in the
macro or in VB to open the child form:

Parent form: frmGrantSumDE
Subform: sfrmProgressPaymentSum
Key Field: RReq# (numeric)
Form being opened: frmProgress

I have tried a multitude of combinations similar to the one below without
success. Does the tab control need to be referenced in the where condition?
Can someone help me?

Thanks, Lloyd

"[RReq#] =" & [Forms].[frmGrantSumDE].[sfrmProgressPaymentSum].[RReq#]

and

"[RReq#] =" & [sfrmProgressPaymentSum.form].[RReq#]
 
D

Dirk Goldgar

Lloyd said:
I regularly use a continuous form with a command button to allow the
user to go to more detail about a specific record. Normally, I
simply do this with a macro. However, in this case the continuous
form is a subform on a tab control and I am unable to get the correct
syntax in a where condition in the macro or in VB to open the child
form:

Parent form: frmGrantSumDE
Subform: sfrmProgressPaymentSum
Key Field: RReq# (numeric)
Form being opened: frmProgress

I have tried a multitude of combinations similar to the one below
without success. Does the tab control need to be referenced in the
where condition? Can someone help me?

Thanks, Lloyd

"[RReq#] =" & [Forms].[frmGrantSumDE].[sfrmProgressPaymentSum].[RReq#]

and

"[RReq#] =" & [sfrmProgressPaymentSum.form].[RReq#]

If "sfrmProgressPaymentSum" is actually the name of the subform control
on the main form, and not justthe name of the form that it displays as
its Source Object, then this ought to work:

"[RReq#] =" & Forms!frmGrantSumDE!sfrmProgressPaymentSum![RReq#]

It's just possible you may need to specify the .Form property of the
subform:

"[RReq#] =" & Forms!frmGrantSumDE!sfrmProgressPaymentSum.Form![RReq#]
 
G

Guest

Thanks for the tips Dirk. Understanding the distinction between the object
and the control source and using "!" insteadof "." were the keys.

Dirk Goldgar said:
Lloyd said:
I regularly use a continuous form with a command button to allow the
user to go to more detail about a specific record. Normally, I
simply do this with a macro. However, in this case the continuous
form is a subform on a tab control and I am unable to get the correct
syntax in a where condition in the macro or in VB to open the child
form:

Parent form: frmGrantSumDE
Subform: sfrmProgressPaymentSum
Key Field: RReq# (numeric)
Form being opened: frmProgress

I have tried a multitude of combinations similar to the one below
without success. Does the tab control need to be referenced in the
where condition? Can someone help me?

Thanks, Lloyd

"[RReq#] =" & [Forms].[frmGrantSumDE].[sfrmProgressPaymentSum].[RReq#]

and

"[RReq#] =" & [sfrmProgressPaymentSum.form].[RReq#]

If "sfrmProgressPaymentSum" is actually the name of the subform control
on the main form, and not justthe name of the form that it displays as
its Source Object, then this ought to work:

"[RReq#] =" & Forms!frmGrantSumDE!sfrmProgressPaymentSum![RReq#]

It's just possible you may need to specify the .Form property of the
subform:

"[RReq#] =" & Forms!frmGrantSumDE!sfrmProgressPaymentSum.Form![RReq#]

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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