Go to New record on 2nd subform

G

Guest

I have frmMain and 2 subfoms (control names on frmMain - frmTransSub and
frmLOBSub). Both subs are linked to frmMain. I am having problem going to a
new record on the frmLOBSub FROM frmTransSub.

On the frmTransSub_AfterUpdate I have:

If checkDuplicate Then
Forms!frmMain!frmLOBSub.Form!FMS.SetFocus
Else
DoCmd.GoToRecord acDataForm, Forms!frmMain!frmLOBSub.Form, acNewRec
End If

The problem is in the else statement. I get the wrong data type in
expression error. If I put quotes around the form reference, I get the form
not open error.

Any ideas?
 
G

Guest

I think I have tried setting focus on the subform and then telling it to go
to a new record on the active object.

Forms!frmMain!frmLOBSub.Form!FMS.SetFocus
DoCmd.GoToRecord acActiveDataObject, , acNewRec

Hope this helps!
dc
 
G

Guest

Forms!frmMain!frmLOBSub.Form!FMS.SetFocus is returning a "2105 - You can't go
to the specific record" error?
 
G

Guest

Sorry, I just copied that from your code sample and then forgot to edit it.
Does it work if your "checkduplicate" comes back true?

Try...

Forms!frmMain!frmLOBSub.setfocus

HTH
dc
 

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