B
Bonnie
Using A02 on XP. I have a display form that shows SACode
with a query that is no updatable. I have a model edit
form to change certain data. I have the model form open to
the Plan # for edits. When I close the model form, I need
to return to the display form with the data refreshed to
show the newly edited info. Here is what I have thanks to
the help of someone named Emilia Maxim a few weeks ago.
Here is what I have:
Private Sub Command15_Click()
On Error GoTo Err_Command15_Click
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.RunCommand acCmdSaveRecord
stDocName = "Welcome Screen"
stLinkCriteria = "[Plan #]=" & "'" & Me![Plan #] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, Forms!fChgSACode, acSaveYes
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click
End Sub
When I click the button, I do flip back to the display
form but get this dialog message: An expression you
entered is the wrong data type for one of the arguments.
The edit model edit form is still open behind the display
form. I'm sure my problem is on the DoCmd.Close
acForm,Forms!fChgSACode line. I have tried to word it but
think I am identifying the form incorrectly. I don't think
I need to use the acSave part as that saves form changes
rather than edits to data, correct? I put it in anyway but
would rather not if I don't need it.
I know that it's something simple that I'm missing. Thanks
in advance for any help or advice!!!
with a query that is no updatable. I have a model edit
form to change certain data. I have the model form open to
the Plan # for edits. When I close the model form, I need
to return to the display form with the data refreshed to
show the newly edited info. Here is what I have thanks to
the help of someone named Emilia Maxim a few weeks ago.
Here is what I have:
Private Sub Command15_Click()
On Error GoTo Err_Command15_Click
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.RunCommand acCmdSaveRecord
stDocName = "Welcome Screen"
stLinkCriteria = "[Plan #]=" & "'" & Me![Plan #] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, Forms!fChgSACode, acSaveYes
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click
End Sub
When I click the button, I do flip back to the display
form but get this dialog message: An expression you
entered is the wrong data type for one of the arguments.
The edit model edit form is still open behind the display
form. I'm sure my problem is on the DoCmd.Close
acForm,Forms!fChgSACode line. I have tried to word it but
think I am identifying the form incorrectly. I don't think
I need to use the acSave part as that saves form changes
rather than edits to data, correct? I put it in anyway but
would rather not if I don't need it.
I know that it's something simple that I'm missing. Thanks
in advance for any help or advice!!!