Access 2007: Splitforms and new records

J

J

I'm trying to open a split form and fill in some (not all) of the
required fields automatically for the user. Unfortunately, the cursor
gets stuck!



Here's how to recreate:

Table 1: Create a table with at least two text fields, both required.
Form1, "frmSplit": Select Table1 and choose Ribbon->Create->Splitform
Name one of the text controls "txtField1"
Under "frmSplit"'s OnOpen event, put in:

Private Sub Form_Open(Cancel As Integer)
If Nz(Me.OpenArgs, "") <> "" Then
DoCmd.GoToRecord acDataForm, Me.Form.Name, acNewRec
txtField1 = Me.OpenArgs
End If
End Sub

Form2, "frmCaller": Create a blank form with just a command button
that has the following code:

Private Sub Command0_Click()
DoCmd.OpenForm "frmSplit", , , , , , "FilledInAlready"
End Sub



Try it. You won't be able to save the record because your cursor will
be stuck on the first control. You'll be forced to use "Esc" to
cancel the record.

Things I know:
1) This isn't a problem with a regular form set to open without split
form view
2) Saving the record with a Me.Refresh does seem to solve the problem,
but not if you want the user to open the form with several required
fields starting blank.

Any ideas?

Thanks for any help,
~J
PS. I can provide a sample accdb if requested.
 

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