simple can't find form question

  • Thread starter Thread starter Mark Kubicki
  • Start date Start date
M

Mark Kubicki

I have a form with some simple code behind it which reads like this:

with Forms![frmNextFixtureTypeOption]
.[lblNextAlpha].Caption = strNextAlpha
.[lblNextNumeric].Caption = strNextNumeric
end with

stDocName = "frmNextFixtureTypeOption"
DoCmd.OpenForm stDocName, , , stLinkCriteria

the second part (where I open the form) works fine, but the first (where I
set the caption for 2 of the controls) does not - it returns an error
"can't find form"...


as always, many thanks in advance,
mark
 
I have a form with some simple code behind it which reads like this:

with Forms![frmNextFixtureTypeOption]
.[lblNextAlpha].Caption = strNextAlpha
.[lblNextNumeric].Caption = strNextNumeric
end with

stDocName = "frmNextFixtureTypeOption"
DoCmd.OpenForm stDocName, , , stLinkCriteria

the second part (where I open the form) works fine, but the first (where I
set the caption for 2 of the controls) does not - it returns an error
"can't find form"...

That's because it isn't open yet. The Forms! collection contains only *OPEN*
forms.

Move the first four lines after the OpenForm event line.
 
Back
Top