Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004

    Unanswered: Fill a box from subform depending on source

    Hello all,

    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.

    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2004

    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
    End If
    If Forms!frmAssessment.txtEffortOrigin.Value = "AE2" Then
    Forms!frmAssessment.AssessmentEffort2 = 1
    End If
    If Forms!frmAssessment.txtEffortOrigin.Value = "AE3" Then
    Forms!frmAssessment.AssessmentEffort3 = 1
    End If
    If Forms!frmAssessment.txtEffortOrigin.Value = "AE4" Then
    Forms!frmAssessment.AssessmentEffort4 = 1
    End If

    Forms!frmAssessment.txtEffortOrigin.Value = ""
    Me.Visible = False

    End Sub

    Messy but seems to work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts