Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Posts
    64

    How to make a field visible if other dependent field is completed?

    I have 2 fields in a form:
    1) A drop down list to describe call results sales reps make. One of the call results is: Call Again
    2) Second field I have is: Call Again Date

    I want to make "Call Again Date" field visible only when sales rep selects "Call Again" from the drop down list on field 1.
    They select Call Again (field 1).
    Call Again Date (field 2) becomes visible. So they can fill out the date a customer wants to be called back.

    If sales rep selects any other option from the drop down list on field 1, then I don't want Call Again Date to be visible.

    How do I do this?
    Thanks.

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,001
    Are you familiar with using VBA code underneath your forms?

    On the AfterUpdate event of the List Box control, use something like:
    Code:
    If Me.ListBox = "Call Again" Then Me.CallBackDate.Visible = True Else Me.CallBackDate.Visible = False

  3. #3
    Join Date
    Jan 2004
    Posts
    64

    Is it not working because they're both combo fields?

    I tried this as you explained:

    It's not working and I think I might know why but don't know how to fix it.
    Call_Results_ID can't be "Call Again" because this is a drop down list as well and it's a number which is 8.

    So I tried;
    1- Putting 8 for Call_Results_ID.

    Private Sub Call_Results_ID_AfterUpdate()
    If Me.Call_Results_ID = "8" Then Me.Call_Again_Date.Visible = True Else Me.Call_Again_Date.Visible = False
    End Sub

    It didn't work.

    2- I tried this:
    Private Sub Call_Results_ID_AfterUpdate()
    Me.Call_Again_Date.Visible = (Me.Call_Results_ID = "Call Again")
    End Sub.

    It didn't work either.

    What am I doing wrong?

  4. #4
    Join Date
    May 2004
    Posts
    15
    Try the following since me.call_results_id is a number and not a string.
    Private Sub Call_Results_ID_AfterUpdate()
    If Me.Call_Results_ID = 8 Then
    Me.Call_Again_Date.Visible = True
    Else
    Me.Call_Again_Date.Visible = False
    End Sub

  5. #5
    Join Date
    Jan 2004
    Posts
    64
    Private Sub Combo8_AfterUpdate()
    If Me.Combo8 = "Call Again" Then
    Me.callagaindate.Visible = True
    Else
    Me.callagaindate.Visible = False
    End If
    End Sub

    This worked on a sample table I created. It won't work with the other table since there are more than one rows in that table depending on how many calls were made to that customer on different dates.
    So if a sales rep calls a customer on 05/20/04 and the call result for that day might be "Left Message".
    And when the sales reps calls the customer again on 05/22/04 and the call result is "Call Again", there'll be 2 result sets with different call result.
    So I don't think this would work.

    I appreciate everyone's generous support.

    Thank you all very much.

Posting Permissions

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