Subform activation (1 Viewer)

MrGPV

New member
Local time
Today, 11:17
Joined
Jan 5, 2005
Messages
6
I've created a form including a subform. I want this subform to be active (visible) ONLY if one specific field of the form has a designated value. (It's a list)
I've used form_load and fieldname_afterupdate but it doesn't update automatically. Worse : when I click to get to the next data, the subform remains visible or invisible, not depending on the field value.

Can anyone help me ?
 

trucktime

Registered User.
Local time
Today, 04:17
Joined
Oct 24, 2004
Messages
556
Visible

In the On Current Event of the Main Form put something like this:

If Me.textfield = "value" Then
Me.mysubform.Visible = False
Else
Me.mysubform.Visible = True
End If
 

MrGPV

New member
Local time
Today, 11:17
Joined
Jan 5, 2005
Messages
6
sorry, it doesn't work with
Private Sub Form_Current()
 
Last edited:
R

Rich

Guest
You have to Call the code in the form current in the AfterUpadate event of your textbox too

Call Form_Current
 

MrGPV

New member
Local time
Today, 11:17
Joined
Jan 5, 2005
Messages
6
well, ok, when i update the field it works now

there still the problem that if the subform is activated when i click to see the next record, it remains activated with the next record even if the field value is not the good one
 

Users who are viewing this thread

Top Bottom