Well...you asked for it
Snapshot = Questionnaire
Individual = Person
txtQLSRID = QuestionnaireID
txtIndividualID = PersonID
Those above are the actual names that I used for my database.
Below is my original tested code that takes you back to the person and
the first questionnaire.
Private Sub cmdSubmit_Click()
On Error GoTo Err_cmdMainMenu_Click
Dim split_array
split_array = Split(Me.OpenArgs, "|")
Dim AddSnapshot As Recordset
Set AddSnapshot = CurrentDb.OpenRecordset("tblQLSR", dbOpenDynaset)
If split_array(1) = "New" Then
AddSnapshot.AddNew
Else
AddSnapshot.FindFirst "[IndividualID] = '" & split_array(0) & "'
And [SnapshotDate] = #" & split_array(1) & "#"
AddSnapshot.Edit
End If
If split_array(1) = "New" Then
If IsNull(Me.txtIndividualID.Value) Or
IsNull(Me.txtCareCoordinatorFirstName.Value) Or
IsNull(Me.txtCareCoordinatorLastName.Value) Or
IsNull(Me.txtSnapshotDate.Value) Or IsNull(Me.txtTitle.Value) Or
IsNull(Me.txtNetwork.Value) Or IsNull(Me.cboEnvironment.Value) Or
IsNull(Me.Location.Value) Or IsNull(Me.txtQLSRID.Value) Then
MsgBox "All fields are required"
ElseIf MsgBox("Add snapshot?", vbYesNo, "Confirm addition") = vbYes
Then
AddSnapshot!IndividualID = Me.txtIndividualID.Value
AddSnapshot!SnapshotDate = Me.txtSnapshotDate.Value
AddSnapshot!SnapshotID = Me.txtQLSRID.Value
AddSnapshot!EvaluatorFName =
Me.txtCareCoordinatorFirstName.Value
AddSnapshot!EvaluatorLName =
Me.txtCareCoordinatorLastName.Value
AddSnapshot!Title = Me.txtTitle.Value
AddSnapshot!PlanOfCareDate = Me.PlanOfCareDate.Value
AddSnapshot!Network = Me.txtNetwork.Value
AddSnapshot!Environment = Me.cboEnvironment.Value
AddSnapshot!Location = Me.Location.Value
AddSnapshot!Score = Me.txtScore.Value
AddSnapshot!Individuality1 = Me.chkIndiv1.Value
AddSnapshot!Individuality2 = Me.chkIndiv2.Value
AddSnapshot!Individuality3 = Me.chkIndiv3.Value
AddSnapshot!Individuality4 = Me.chkIndiv4.Value
AddSnapshot!Individuality5 = Me.chkIndiv5.Value
AddSnapshot!Integration1 = Me.chkInteg1.Value
AddSnapshot!Integration2 = Me.chkInteg2.Value
AddSnapshot!Integration3 = Me.chkInteg3.Value
AddSnapshot!Integration4 = Me.chkInteg4.Value
AddSnapshot!Integration5 = Me.chkInteg5.Value
AddSnapshot!Relationships1 = Me.chkRel1.Value
AddSnapshot!Relationships2 = Me.chkRel2.Value
AddSnapshot!Relationships3 = Me.chkRel3.Value
AddSnapshot!Relationships4 = Me.chkRel4.Value
AddSnapshot!Relationships5 = Me.chkRel5.Value
AddSnapshot!Security1 = Me.chkSec1.Value
AddSnapshot!Security2 = Me.chkSec2.Value
AddSnapshot!Security3 = Me.chkSec3.Value
AddSnapshot!Security4 = Me.chkSec4.Value
AddSnapshot!Security5 = Me.chkSec5.Value
AddSnapshot!Choice1 = Me.chkChoice1.Value
AddSnapshot!Choice2 = Me.chkChoice2.Value
AddSnapshot!Choice3 = Me.chkChoice3.Value
AddSnapshot!Choice4 = Me.chkChoice4.Value
AddSnapshot!Choice5 = Me.chkChoice5.Value
AddSnapshot!Opportunity1 = Me.chkOpp1.Value
AddSnapshot!Opportunity2 = Me.chkOpp2.Value
AddSnapshot!Opportunity3 = Me.chkOpp3.Value
AddSnapshot!Opportunity4 = Me.chkOpp4.Value
AddSnapshot!Opportunity5 = Me.chkOpp5.Value
AddSnapshot!Dignity1 = Me.chkDig1.Value
AddSnapshot!Dignity2 = Me.chkDig2.Value
AddSnapshot!Dignity3 = Me.chkDig3.Value
AddSnapshot!Dignity4 = Me.chkDig4.Value
AddSnapshot!Dignity5 = Me.chkDig5.Value
AddSnapshot!SelfAdvocacy1 = Me.chkSelf1.Value
AddSnapshot!SelfAdvocacy2 = Me.chkSelf2.Value
AddSnapshot!SelfAdvocacy3 = Me.chkSelf3.Value
AddSnapshot!SelfAdvocacy4 = Me.chkSelf4.Value
AddSnapshot!SelfAdvocacy5 = Me.chkSelf5.Value
AddSnapshot!Independence1 = Me.chkIndep1.Value
AddSnapshot!Independence2 = Me.chkIndep2.Value
AddSnapshot!Independence3 = Me.chkIndep3.Value
AddSnapshot!Independence4 = Me.chkIndep4.Value
AddSnapshot!Independence5 = Me.chkIndep5.Value
AddSnapshot!Independence6 = Me.chkIndep6.Value
AddSnapshot!Independence7 = Me.chkIndep7.Value
AddSnapshot!Independence8 = Me.chkIndep8.Value
AddSnapshot!Independence9 = Me.chkIndep9.Value
AddSnapshot!Independence10 = Me.chkIndep10.Value
AddSnapshot!Joy1 = Me.chkJoy1.Value
AddSnapshot!Joy2 = Me.chkJoy2.Value
AddSnapshot!Joy3 = Me.chkJoy3.Value
AddSnapshot!Joy4 = Me.chkJoy4.Value
AddSnapshot!Joy5 = Me.chkJoy5.Value
AddSnapshot!Staff1 = Me.chkStaff1.Value
AddSnapshot!Staff2 = Me.chkStaff2.Value
AddSnapshot!Staff3 = Me.chkStaff3.Value
AddSnapshot!Staff4 = Me.chkStaff4.Value
AddSnapshot!Staff5 = Me.chkStaff5.Value
AddSnapshot!Staff6 = Me.chkStaff6.Value
AddSnapshot.Update
If MsgBox("Snapshot added. Choose YES to add another snapshot or NO
to return to View Data", vbYesNo, "Select Yes/No") = vbYes Then
Me.txtQLSRID.Value = ""
Me.txtSnapshotDate.Value = ""
Me.txtCareCoordinatorFirstName.Value = ""
Me.txtCareCoordinatorLastName.Value = ""
Me.txtTitle.Value = ""
Me.PlanOfCareDate.Value = ""
Me.txtNetwork.Value = ""
Me.cboEnvironment.Value = ""
Me.Location.Value = ""
Me.chkIndiv1.Value = ""
Me.chkIndiv2.Value = ""
Me.chkIndiv3.Value = ""
Me.chkIndiv4.Value = ""
Me.chkIndiv5.Value = ""
Me.chkInteg1.Value = ""
Me.chkInteg2.Value = ""
Me.chkInteg3.Value = ""
Me.chkInteg4.Value = ""
Me.chkInteg5.Value = ""
Me.chkRel1.Value = ""
Me.chkRel2.Value = ""
Me.chkRel3.Value = ""
Me.chkRel4.Value = ""
Me.chkRel5.Value = ""
Me.chkSec1.Value = ""
Me.chkSec2.Value = ""
Me.chkSec3.Value = ""
Me.chkSec4.Value = ""
Me.chkSec5.Value = ""
Me.chkChoice1.Value = ""
Me.chkChoice2.Value = ""
Me.chkChoice3.Value = ""
Me.chkChoice4.Value = ""
Me.chkChoice5.Value = ""
Me.chkOpp1.Value = ""
Me.chkOpp2.Value = ""
Me.chkOpp3.Value = ""
Me.chkOpp4.Value = ""
Me.chkOpp5.Value = ""
Me.chkDig1.Value = ""
Me.chkDig2.Value = ""
Me.chkDig3.Value = ""
Me.chkDig4.Value = ""
Me.chkDig5.Value = ""
Me.chkSelf1.Value = ""
Me.chkSelf2.Value = ""
Me.chkSelf3.Value = ""
Me.chkSelf4.Value = ""
Me.chkSelf5.Value = ""
Me.chkIndep1.Value = ""
Me.chkIndep2.Value = ""
Me.chkIndep3.Value = ""
Me.chkIndep4.Value = ""
Me.chkIndep5.Value = ""
Me.chkIndep6.Value = ""
Me.chkIndep7.Value = ""
Me.chkIndep8.Value = ""
Me.chkIndep9.Value = ""
Me.chkIndep10.Value = ""
Me.chkJoy1.Value = ""
Me.chkJoy2.Value = ""
Me.chkJoy3.Value = ""
Me.chkJoy4.Value = ""
Me.chkJoy5.Value = ""
Me.chkStaff1.Value = ""
Me.chkStaff2.Value = ""
Me.chkStaff3.Value = ""
Me.chkStaff4.Value = ""
Me.chkStaff5.Value = ""
Me.chkStaff6.Value = ""
Else
AddSnapshot.Close
DoCmd.OpenForm "frmIndividual", , , , , , [txtIndividualID]
DoCmd.Close acForm, Me.Name
End If
End If
ElseIf MsgBox("Submit changes and exit?", vbYesNo, "Edit Snapshot") =
vbYes Then
If IsNull(Me.txtIndividualID.Value) Or
IsNull(Me.txtCareCoordinatorFirstName.Value) Or
IsNull(Me.txtCareCoordinatorLastName.Value) Or
IsNull(Me.txtSnapshotDate.Value) Or IsNull(Me.txtTitle.Value) Or
IsNull(Me.txtNetwork.Value) Or IsNull(Me.cboEnvironment.Value) Or
IsNull(Me.Location.Value) Then
MsgBox "All fields are required"
Else
AddSnapshot!IndividualID = Me.txtIndividualID.Value
AddSnapshot!SnapshotDate = Me.txtSnapshotDate.Value
AddSnapshot!SnapshotID = Me.txtQLSRID.Value
AddSnapshot!EvaluatorFName =
Me.txtCareCoordinatorFirstName.Value
AddSnapshot!EvaluatorLName =
Me.txtCareCoordinatorLastName.Value
AddSnapshot!Title = Me.txtTitle.Value
AddSnapshot!PlanOfCareDate = Me.PlanOfCareDate.Value
AddSnapshot!Network = Me.txtNetwork.Value
AddSnapshot!Environment = Me.cboEnvironment.Value
AddSnapshot!Location = Me.Location.Value
AddSnapshot!Score = Me.txtScore.Value
AddSnapshot!Individuality1 = Me.chkIndiv1.Value
AddSnapshot!Individuality2 = Me.chkIndiv2.Value
AddSnapshot!Individuality3 = Me.chkIndiv3.Value
AddSnapshot!Individuality4 = Me.chkIndiv4.Value
AddSnapshot!Individuality5 = Me.chkIndiv5.Value
AddSnapshot!Integration1 = Me.chkInteg1.Value
AddSnapshot!Integration2 = Me.chkInteg2.Value
AddSnapshot!Integration3 = Me.chkInteg3.Value
AddSnapshot!Integration4 = Me.chkInteg4.Value
AddSnapshot!Integration5 = Me.chkInteg5.Value
AddSnapshot!Relationships1 = Me.chkRel1.Value
AddSnapshot!Relationships2 = Me.chkRel2.Value
AddSnapshot!Relationships3 = Me.chkRel3.Value
AddSnapshot!Relationships4 = Me.chkRel4.Value
AddSnapshot!Relationships5 = Me.chkRel5.Value
AddSnapshot!Security1 = Me.chkSec1.Value
AddSnapshot!Security2 = Me.chkSec2.Value
AddSnapshot!Security3 = Me.chkSec3.Value
AddSnapshot!Security4 = Me.chkSec4.Value
AddSnapshot!Security5 = Me.chkSec5.Value
AddSnapshot!Choice1 = Me.chkChoice1.Value
AddSnapshot!Choice2 = Me.chkChoice2.Value
AddSnapshot!Choice3 = Me.chkChoice3.Value
AddSnapshot!Choice4 = Me.chkChoice4.Value
AddSnapshot!Choice5 = Me.chkChoice5.Value
AddSnapshot!Opportunity1 = Me.chkOpp1.Value
AddSnapshot!Opportunity2 = Me.chkOpp2.Value
AddSnapshot!Opportunity3 = Me.chkOpp3.Value
AddSnapshot!Opportunity4 = Me.chkOpp4.Value
AddSnapshot!Opportunity5 = Me.chkOpp5.Value
AddSnapshot!Dignity1 = Me.chkDig1.Value
AddSnapshot!Dignity2 = Me.chkDig2.Value
AddSnapshot!Dignity3 = Me.chkDig3.Value
AddSnapshot!Dignity4 = Me.chkDig4.Value
AddSnapshot!Dignity5 = Me.chkDig5.Value
AddSnapshot!SelfAdvocacy1 = Me.chkSelf1.Value
AddSnapshot!SelfAdvocacy2 = Me.chkSelf2.Value
AddSnapshot!SelfAdvocacy3 = Me.chkSelf3.Value
AddSnapshot!SelfAdvocacy4 = Me.chkSelf4.Value
AddSnapshot!SelfAdvocacy5 = Me.chkSelf5.Value
AddSnapshot!Independence1 = Me.chkIndep1.Value
AddSnapshot!Independence2 = Me.chkIndep2.Value
AddSnapshot!Independence3 = Me.chkIndep3.Value
AddSnapshot!Independence4 = Me.chkIndep4.Value
AddSnapshot!Independence5 = Me.chkIndep5.Value
AddSnapshot!Independence6 = Me.chkIndep6.Value
AddSnapshot!Independence7 = Me.chkIndep7.Value
AddSnapshot!Independence8 = Me.chkIndep8.Value
AddSnapshot!Independence9 = Me.chkIndep9.Value
AddSnapshot!Independence10 = Me.chkIndep10.Value
AddSnapshot!Joy1 = Me.chkJoy1.Value
AddSnapshot!Joy2 = Me.chkJoy2.Value
AddSnapshot!Joy3 = Me.chkJoy3.Value
AddSnapshot!Joy4 = Me.chkJoy4.Value
AddSnapshot!Joy5 = Me.chkJoy5.Value
AddSnapshot!Staff1 = Me.chkStaff1.Value
AddSnapshot!Staff2 = Me.chkStaff2.Value
AddSnapshot!Staff3 = Me.chkStaff3.Value
AddSnapshot!Staff4 = Me.chkStaff4.Value
AddSnapshot!Staff5 = Me.chkStaff5.Value
AddSnapshot!Staff6 = Me.chkStaff6.Value
AddSnapshot.Update
AddSnapshot.Close
DoCmd.OpenForm "frmIndividual", , , , , , [txtIndividualID]
DoCmd.Close acForm, Me.Name
End If
End If
Thanks,
Sergios