From: Mark Kubicki on
I have some code that reads:
go to next record,
if the next record is a new record,
based on the value of the previous record, assign a specific value to a
particular field OR open a modal form that offers some choices for the value
to be assigned

in both cases, if the new value is "X" , assign the new value to that
record, and then add another new record with a value of "X+1" assign to the
field (and go tot hat record for edits)

I have no problem doing this when I am in the first situation (not needing
to open the second form), but from the second form, I am lost

here's some snippets of the code:
on the main form "frmSpec":

With frm
If IsNumeric(Right(strInitial, 1)) Then
stDocName = "frmNextFixtureTypeOption"
DoCmd.OpenForm stDocName, , , stLinkCriteria ', , acDialog,
With Forms![frmNextFixtureTypeOption]
.[lblInitialAlpha].Caption = strInitialAlpha
.[lblNextAlpha].Caption = strNextAlpha
.[lblNextNumeric].Caption = strNextNumeric
End With
.txtType = strNextAlpha
'if next type is an "o" or "x" then add as not used type and
advance to next type
If Ucase(Right(strNextAlpha, 1)) = "O" Or
Ucase(Right(strNextAlpha, 1)) = "X" Then
.basedescription = "NOT USED"
strNextAlpha = Mid(strNextAlpha, 1, Len(strNextAlpha) - 1) &
Chr(Asc(Right(strNextAlpha, 1)) + 1)
DoCmd.GoToRecord , , acNext
.txtType = strNextAlpha
End If
End If
End With

and behind the pop-up form "frmNextFixtureTypeOption"

Private Sub cmdNextAlpha_Click()
Forms![frmSpec].txtType = Me.lblNextAlpha.Caption

' this is where I need to add code to check the value of
Forms![frmSpec].txtType, and potentially add the second record

End Sub

any suggestions would be greatly appreciated,
many thanks in advance,