ACC2000: Run-time error 2450--Move from form to subform to subfor

B

BrentDA

Having a problem moving (tabbing) from a main form to a subform then to a 2nd
subform.

I have a main form with text boxes. The main form also has 2 subforms, also
with text boxes. I checked the Tab Order, and it shows correctly the names
of the text boxes on the main form, followed by the names of the 1st and 2nd
subforms.

In the 'On Open' of the 3 forms I have the following code to open the forms
with a new, blank record: DoCmd.GoToRecord , , acNewRec. That works great.

The code I have in the On Exit of the last text box in the main form (to go
to the 1st subform) is: Forms!frmsubForm1!nameoftextboxon1stsubform.SetFocus

When I tab from the last text box on the main form (after inputting numeric
data) to go to the 1st text box on the 1st subform, I get the following error:

"Run-time error '2450':

Database can't find the form 'frmsubForm1' referred to in a macro expression
or Visual Basic Code."

The name of the subform is correct. I just changed it for this example.

I have tried other code variations (including GoToControl) in On Load, After
Update and On Lost Focus of the last text box of the main form.

I think I'm going in the right direction. I'm just not exactly sure of the
wording on the code, or where to place the code.

Any assistance is greatly appreciated !

Thanks !

Brent
 
B

BrentDA

I found the following code in one of the mpa formscoding threads:

DoCmd.OpenForm "frmQuoteSheetMaster"

Now my form almost works. Instead of tabbing from one form to the next,
like it's supposed to, it opens the subform rather than tabbing to the actual
subform embedded in the main form.

Thanks in advance for your help !

Brent
 

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