G
Guest
Hello All:
I have a main form where all geographic information is keyed for a contract.
I then have several subforms connected through Command buttons. I have events
setup on click that auto-populates those fields on the subform with the same
info but my problem is if i go back into a record and edit one of those
fields, the change is in the subform's table but not on the subform itself.
So it will end up looking like this:
Main form: keyed "Thomas" into ContractSpecialist field
Sub form: auto populates with "Thomas" in ContractSpecialist field
Main form: edit "Thomas" replace with "George" in ContractSpecialist field
Sub form: "Thomas" remains in ContractSpecialist field after update
Sub form Table: updates "Thomas" replace with "Geroge: in ContractSpecialist
field after update
Here is some background on the forms if it helps:
Main Form Name: Contract Profile
Main form has the following events:
Private Sub Form_Load()
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
End Sub
'END OF SUBROUTINE
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
End Sub
Command Button used to open subform has this event:
Private Sub Review_Assessment_Click()
On Error GoTo Err_Review_Assessment_Click
If IsNull(Me![ID]) Then
MsgBox "Enter Contract information before viewing Contract Review
Assessment form."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Contracts Review Assessment", , , "[Contracts Review
Assessment]![ID] = Forms![Contract Profile]![ID]"
End If
Exit_Review_Assessment_Click:
Exit Sub
Err_Review_Assessment_Click:
MsgBox Err.Description
Resume Exit_Review_Assessment_Click
End Sub
ContractSpecialist field has the following expression in table and form
properties
Table- Combo set to Table/Query with the following expresion:
=[Forms]![Contract Profile]![ContractSpecialistID]
Form-
=[Forms]![Contract Profile]![ContractSpecialistID]
Subform has the following properties and events:
Record Source- SELECT DISTINCTROW [Contract Review Assessment].* FROM
[Contract Review Assessment] WHERE (([Contract Review
Assessment].ID=forms![Contract Profile]!ID));
Filter- [Contracts Review Assessment]![ID] = Forms![Contract Profile]![ID]
Private Sub Form_Activate()
On Error GoTo Err_Form_Activate
Me.Requery
Exit_Form_Activate:
Exit Sub
Err_Form_Activate:
MsgBox Err.Description
Resume Exit_Form_Activate
End Sub
I have a main form where all geographic information is keyed for a contract.
I then have several subforms connected through Command buttons. I have events
setup on click that auto-populates those fields on the subform with the same
info but my problem is if i go back into a record and edit one of those
fields, the change is in the subform's table but not on the subform itself.
So it will end up looking like this:
Main form: keyed "Thomas" into ContractSpecialist field
Sub form: auto populates with "Thomas" in ContractSpecialist field
Main form: edit "Thomas" replace with "George" in ContractSpecialist field
Sub form: "Thomas" remains in ContractSpecialist field after update
Sub form Table: updates "Thomas" replace with "Geroge: in ContractSpecialist
field after update
Here is some background on the forms if it helps:
Main Form Name: Contract Profile
Main form has the following events:
Private Sub Form_Load()
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
End Sub
'END OF SUBROUTINE
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
End Sub
Command Button used to open subform has this event:
Private Sub Review_Assessment_Click()
On Error GoTo Err_Review_Assessment_Click
If IsNull(Me![ID]) Then
MsgBox "Enter Contract information before viewing Contract Review
Assessment form."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Contracts Review Assessment", , , "[Contracts Review
Assessment]![ID] = Forms![Contract Profile]![ID]"
End If
Exit_Review_Assessment_Click:
Exit Sub
Err_Review_Assessment_Click:
MsgBox Err.Description
Resume Exit_Review_Assessment_Click
End Sub
ContractSpecialist field has the following expression in table and form
properties
Table- Combo set to Table/Query with the following expresion:
=[Forms]![Contract Profile]![ContractSpecialistID]
Form-
=[Forms]![Contract Profile]![ContractSpecialistID]
Subform has the following properties and events:
Record Source- SELECT DISTINCTROW [Contract Review Assessment].* FROM
[Contract Review Assessment] WHERE (([Contract Review
Assessment].ID=forms![Contract Profile]!ID));
Filter- [Contracts Review Assessment]![ID] = Forms![Contract Profile]![ID]
Private Sub Form_Activate()
On Error GoTo Err_Form_Activate
Me.Requery
Exit_Form_Activate:
Exit Sub
Err_Form_Activate:
MsgBox Err.Description
Resume Exit_Form_Activate
End Sub