Access 2000 - Visibible Fields

G

GMC

Hello all,

I have a field named Field213 that holds (CASETYPE) from the database. When
I open the form, I want it to look at that field and make field163 visible
depending on what it stored in Field213. Right now it only becomes visible
if I manually change what is in field213, then field163 becomes visible. I
should mention that I have field163 as visible no and display always, the
same as field PBISUB, Field382 and Field163. Probably something simple, but
I can't seem to see it right now.

I have the following:

Private Sub Field213_BeforeUpdate(iC As Integer)
If Me!CASETYPE = "P" Then
PBISub.Visible = True ***(This field is working like it should)***
PBISub.Enabled = True
Field163.Visible = True ***(Shouldn't this make the field show up if there
is a "P" in CASETYPE??)***
Field163.Enabled = True
ElseIf Me!CASETYPE = "R" Then
Field382.Visible = True ***(This field is working like it should)***
Field382.Enabled = True
Combo143.Visible = True ***(This field is working like it should)***
Combo143.Enabled = True
Field163.Visible = True ***(Shouldn't this make the field show up if
there is a "P" in CASETYPE??)***
Field163.Enabled = True
End If
If Me!CASETYPE <> "H" Then
Field382.Visible = False
Field382.Enabled = False
Combo143.Visible = False
Combo143.Enabled = False
End If
Exit Sub
P_Err:
RootErr
Resume Next
End Sub

And: In the afterupdate I have

Private Sub Field213_AfterUpdate()
On Error GoTo P_Err
If Me!CASETYPE = "P" Then
PBISub.Visible = True
PBISub.Enabled = True
Field382.Visible = False
Field382.Enabled = False
Field163.Visible = True
Field163.Enabled = True
ElseIf Me!CASETYPE = "R" Then
Field382.Visible = True
Field382.Enabled = True
PBISub.Visible = False
PBISub.Enabled = False
Combo143.Visible = True
Combo143.Enabled = True
Field163.Visible = True
Field163.Enabled = True
Else
PBISub.Visible = False
PBISub.Enabled = False
Field382.Visible = False
Field382.Enabled = False
Combo143.Visible = False
Combo143.Enabled = False
End If
***(Even if I take the following statement out, the field still doesn't show
up)***
If Me!CASETYPE = "R" Then
Me!Field163.RowSource = "SELECT subRCLOSED.RCLOSED, subRCLOSED.RCLOSEDNA
FROM subRCLOSED WHERE (((subRCLOSED.RCLOSED) Like 'R'));"
Else
Me!Field163.RowSource = "Select subRCLOSED.RCLOSED,subRCLOSED.RClosedNA From
subRCLOSED WHERE (((subRCLOSED.RCLOSED) <> 'R'));"
End If
Exit Sub
P_Err:
RootErr
Resume Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top