If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > How to make a field visible if other dependent field is completed?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
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.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Apr 2004
Location: outside the rim
Posts: 998
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
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On