Unanswered: Fill a box from subform depending on source
I have been trying to do this for ages but just can't seem to get it to work.
I have a form with 12 boxes. They need a value set between 1 and 5. To do this I used a subform with 5 buttons. The subform is hidden and appears when the user clicks on the desired box. It then places the appropriate number in the box on the main form and hides the subForm.
The problem is that I can only really work it out by using 1 subform per control. This is messy, and will eventually cause major problems.
This needs to function like the calender control examples that are available on the net.
I have attached a simplified example that only allows 1 box to be filled. Could someone please just have a look at it and see if there is a solution that will allow the other box(s) to be filled.
I fixed it, used a hidden text box on the main form then lots of IFs in the subform.
Private Sub Command0_Click()
Dim strOrigin As String
If Forms!frmAssessment.txtEffortOrigin.Value = "AE1" Then
Forms!frmAssessment.AssessmentEffort = 1
If Forms!frmAssessment.txtEffortOrigin.Value = "AE2" Then
Forms!frmAssessment.AssessmentEffort2 = 1
If Forms!frmAssessment.txtEffortOrigin.Value = "AE3" Then
Forms!frmAssessment.AssessmentEffort3 = 1
If Forms!frmAssessment.txtEffortOrigin.Value = "AE4" Then
Forms!frmAssessment.AssessmentEffort4 = 1