I have a little form that I want to:
1. accept a new primary key (chart number) (this is the only field on the form),
2. add a new record with this primary key,
3. open the main form, and
4. close itself
So far, it does 1 through 3, but doesn't do 4, and also gives me an error, saying that there's an operator missing on line 12 of the following code:
I'm pretty sure that it has something to do with the index, but I don't know how to fix that line (I cribbed it from another module that behaves similarly).
Thanks in advance, because I know someone will have posted the answer almost before I can come back to check for it!
1. accept a new primary key (chart number) (this is the only field on the form),
2. add a new record with this primary key,
3. open the main form, and
4. close itself
So far, it does 1 through 3, but doesn't do 4, and also gives me an error, saying that there's an operator missing on line 12 of the following code:
Code:
Private Sub ChartNum_Exit(Cancel As Integer)
Dim stDocName As String
Dim stMainForm As String
Dim stLinkCriteria As String
stMainForm = "Patient_IUR_Overview"
stDocName = "Patients: Add"
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'DoCmd.Close stDocName
stLinkCriteria = "[Patients.Patient Index]=" & Me![Patient Index]
DoCmd.OpenForm stMainForm, , , stLinkCriteria
Exit_ChartNum_Exit:
Exit Sub
Err_ChartNum_Exit:
MsgBox Err.Description
Resume Exit_ChartNum_Exit
End Sub
Thanks in advance, because I know someone will have posted the answer almost before I can come back to check for it!
Comment