Syntax Problem in accessing a control on a form - Access97
From: Leonard Priestley (priestly_at_ihug.co.nz)
Date: 03/06/04
- Next message: anonymous_at_discussions.microsoft.com: "Validation Rule"
- Previous message: Chris: "requery combo from another screen"
- Next in thread: _at_SPAM-BLOCKER_techie dot com: "Re: Syntax Problem in accessing a control on a form - Access97"
- Reply: _at_SPAM-BLOCKER_techie dot com: "Re: Syntax Problem in accessing a control on a form - Access97"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 6 Mar 2004 17:58:27 +1300
I have a main form (frmMain) which includes a subform (frmHost). I am using
the subform to display any one of several forms, selected by using a command
button which sets the form to be displayed as the SourceObject for the
subform. This works fine.
One of the forms to be displayed (frmToDo) is a continuous form with several
fields. Using command buttons, the user can select which field to sort the
data on. I want to preview and print the data from this form, sorted in the
same way as the user has selected for the form. I identify the command
button pressed by assigning a value to a variable (ReportSelect As Integer).
The value of ReportSelect assigned to an invisible textbox (txtRS), to be
picked up by the report.
When I tried to produce and run a report, it became evident that the sorting
of the data would have to be done before frmToDo processed the line:
DoCmd.OpenReport "rptToDo", acViewPreview
So I added code to the Report Open event, to do the sorting. I began by
picking up the value of txtRS from frmToDo, and then used a Select Case
statement to decide how to sort.
My problem is this: When I work only with frmToDo, and rptToDo, I use this
code to pick up the value of txtRS:
ReportSelect = Forms!frmToDo.txtRS,
and it all works beautifully. But when I take one step back and try to run
it from frmMain, I cannot get the syntax correct. At present I am looking
at the line:
ReportSelect = Forms![frmMain].[frmHost].frmToDo.txtRS
Which produces an error message 'Object doesn't support this property or
method'. I have tried removing [frmToDo] and get the same error message.
Can someone put me right on this please
.
Leonard Priestley
- Next message: anonymous_at_discussions.microsoft.com: "Validation Rule"
- Previous message: Chris: "requery combo from another screen"
- Next in thread: _at_SPAM-BLOCKER_techie dot com: "Re: Syntax Problem in accessing a control on a form - Access97"
- Reply: _at_SPAM-BLOCKER_techie dot com: "Re: Syntax Problem in accessing a control on a form - Access97"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|