![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a subform "frmActivity" which is in datasheet view on the main form. Two of the fields on the subform are "Activity" which is a combo box and "ActivityHours". When "Leave" is selected in the Activity" field, a form entitled "frmLeave" opens. This form has a field entitled "LeaveHours". When I close "frmLeave", I would like the data (a number) from "LeaveHours" to populate the "ActivityHours" field on the subform which will correspond with the record inwhich I entered "Leave". |
#3
| |||
| |||
|
|
A_Classic_Man wrote: I have a subform "frmActivity" which is in datasheet view on the main form. Two of the fields on the subform are "Activity" which is a combo box and "ActivityHours". When "Leave" is selected in the Activity" field, a form entitled "frmLeave" opens. This form has a field entitled "LeaveHours". When I close "frmLeave", I would like the data (a number) from "LeaveHours" to populate the "ActivityHours" field on the subform which will correspond with the record inwhich I entered "Leave". Put code something like this in the combo box's AfterUpdate event: * *DoCmd.OpenForm "frmLeave", WindowMode:=acDialog * *Me.ActivityHours = Forms!frmLeave.LeaveHours * *DoCmd.Close acForm, "frmLeave", acSaveNo Now, the trick is that frmLeave must have a command button that users think closes the form, but the button only make the form invisible: * *Me.Visible = False -- Marsh |
![]() |
| Thread Tools | |
| Display Modes | |
| |