I have a form where you can view the custodian names in a given project.
The form header has the project name you are in, and the detail is continuous with each custodian name. Each record has an edit button to open a form, which will have open args to that custodian id. This edit form has the custodian name in the header, and a continuous detail form with any projects that will be affected by the change. The custodian names are in a tblCustodian table. There is a project custodian table that has the project key and the custodian FK for each custodian to link to projects they are used in.
When I go to the edit custodian form, change the custodian, and go back to the manage project custodians 2 things don't work correctly. The change to the custodian name does not change, and the manage project custodian form does not become invisible. I have referential integrity. The tables are sql based, and linked to access with ODBC. I can open the tables, I can change values in query that the edit form is based on.
Here is the info.
tblCustodian
tblProjectCustodians
Code on frmProjectCustodiansMain
That seems to work. This is the code for the on open of the edit custodian form:
That seems to work too. This is the record source for the edit form:
This is the code that goes back to the manage project custodian form:
The edit custodian form closes, but the change I made to the custodian record, doesn't save. The project custodian form also doesn't become visible. nothing happens. no error.
I have another button on the edit custodian form, to go straight back to the project batch setup form. This is where the user started, when they needed to go manage the project custodians, and then edit one of the custodians. This is the code for that button:
Now this does close the edit form, close the project custodian form and make the project batch set up form visible again. It doesn't save the change to the custodian though. When I go to the query, I get the attached error.
I have checked the link to the tables and it all seems ok. So confused!
Thanks for any help!
misscrf
It is never too late to become what you could have been ~ George Eliot
The form header has the project name you are in, and the detail is continuous with each custodian name. Each record has an edit button to open a form, which will have open args to that custodian id. This edit form has the custodian name in the header, and a continuous detail form with any projects that will be affected by the change. The custodian names are in a tblCustodian table. There is a project custodian table that has the project key and the custodian FK for each custodian to link to projects they are used in.
When I go to the edit custodian form, change the custodian, and go back to the manage project custodians 2 things don't work correctly. The change to the custodian name does not change, and the manage project custodian form does not become invisible. I have referential integrity. The tables are sql based, and linked to access with ODBC. I can open the tables, I can change values in query that the edit form is based on.
Here is the info.
tblCustodian
Code:
ID
Custodian
CreatedBy
Created
ModifiedBy
Modified
tblProjectCustodians
Code:
ID
ProjectKey
FKCustodian
CreatedBy
Created
ModifiedBy
Modified
Code on frmProjectCustodiansMain
Code:
Private Sub cmdEditCustodian_Click()
Dim stOpenArgs As String
stOpenArgs = Me.FKCustodian
DoCmd.OpenForm "frmEditCustodian", , , , , , stOpenArgs
Forms!frmMatterCustodiansMain.Visible = False
End Sub
That seems to work. This is the code for the on open of the edit custodian form:
Code:
Private Sub Form_Open(Cancel As Integer)
With Me.Form
.Filter = "[FKCustodian] = " & Me.OpenArgs
.FilterOn = True
End With
End Sub
That seems to work too. This is the record source for the edit form:
Code:
SELECT tblProjectCustodian.ProjectKey, tblProjectCustodian.FKCustodian, tblCustodian.Custodian
FROM tblProjectCustodian RIGHT JOIN tblCustodian ON tblProjectCustodian.FKCustodian = tblCustodian.ID
WHERE (((tblProjectCustodian.ProjectKey) Is Not Null))
ORDER BY tblProjectCustodian.ProjectKey;
This is the code that goes back to the manage project custodian form:
Code:
Forms!frmProjectCustodiansMain.Visible = True
DoCmd.Close acForm, "frmEditCustodian", acSaveYes
The edit custodian form closes, but the change I made to the custodian record, doesn't save. The project custodian form also doesn't become visible. nothing happens. no error.
I have another button on the edit custodian form, to go straight back to the project batch setup form. This is where the user started, when they needed to go manage the project custodians, and then edit one of the custodians. This is the code for that button:
Code:
Private Sub cmdRetDiscProcessing_Click()
Forms!frmProcessingTracking.Visible = True
DoCmd.Close acForm, "frmEditCustodian", acSaveYes
DoCmd.Close acForm, "frmProjectCustodiansMain", acSaveYes
End Sub
Now this does close the edit form, close the project custodian form and make the project batch set up form visible again. It doesn't save the change to the custodian though. When I go to the query, I get the attached error.
Thanks for any help!
misscrf
It is never too late to become what you could have been ~ George Eliot