Visible Property

Little_Man22

Registered User.
Local time
Today, 15:40
Joined
Jun 23, 2001
Messages
118
Right now I have it so that the following is in the afterupdate event procedure of the canadian status field:

If canadian status = "other" Then
Me.OtherStatus.Visible = True
Else
Me.OtherStatus.Visible = False
End If

This works great when you update the field and actually select 'other' from the combo box. However, if you exit the form and come back in, although the combo box may be set to other, the otherstatus field is not visible (even though it may even have a value entered in it).

How can I get it so that if 'other' is selected, the otherstatus field is permanently visible until possibly a different value is chosen from the combo box.

Thanks,
Ryan.
 
Run the after update event of the canadian status field in the On Load event of the form.

i.e.

Private Sub Form_Load()

CanadianStatus_AfterUpdate

End Sub
 
Sorry ott, you don't do this in the load event, you do it in the onCurrent event. The load event ONLY works for the first record. The onCurrent event works every time you move to a different record.
 
I'm obviously not clear as to what you are trying to do here Pat. If the procedure works when you select an item from the combo box (which triggers the after update event of that combo box), the only time the procedure isn't being called, when it needs to be, is when you are re-opening the form (is this right??). That's why I am suggesting to call the after update event in the form load event as well. That way it will automatically run when the form is first opened and set the visible property of OtherStatus control accordingly. If this isn't the case then I think I am missing a piece of the puzzle.
 
Ott:

People read questions differently. The piece of the puzzle that you are missing is that Little_Man_22 wants to see that second control "permanently" as he put it. The closing and opening of the form is also a OnCurrent event. Therefore, OnCurrent is suitable and will fire as the user moves record to record and displays the second control as needed.

I know I didn't need to tell you about what OnCurrent does. I wrote that to benefit LittleMan22.
 
My misinterpretation jwindon:

I wasn't thinking that LittleMan's form in question was a bound form that was being used to navigate through records. I was viewing it as a switchboard type form where he merely wanted to select an item from a combo box have the "canadian status" control appear or disappear accordingly, and then move on to a new form or procedure. You're right, the OnCurrent event is the right choice for a form that is bound and being used to navigate records.
 
Yet another interpretation that never crossed my mind. You may be right also as LittleMan was not specific as to what type of form he was using although his mentioning of a combo box inclined me to the bound form theory. Good question Ott.

[This message has been edited by jwindon (edited 11-02-2001).]
 
On Current event fires when the form intially forms and when navigating from record to record.

RDH
 

Users who are viewing this thread

Back
Top Bottom