Code is not quite right

Dgavilanes

Registered User.
Local time
Today, 08:04
Joined
Jun 25, 2001
Messages
109
Hi all,
I have this code that it does not work just the way I would like to.

Here is the problem, Is a cbx in a continous form, when I select the value "Pending Affidavit" a "Noyears" field is visible, unfortunaly it does the same for any other value selected
I know it should also reference the records Id No. But don't know how

Any help would be greatly appreciated

thanks

Dennis

Private Sub Form_Current()
Call CbxCode_AfterUpdate
End Sub



Private Sub CbxCode_AfterUpdate()
Me.noyears.Visible = Me.CbxCode.Column(1) = "Pending Affidavit"
End Sub
 
Have you tried an If statement?

Code:
Private Sub Form_Current() 
     Call CbxCode_AfterUpdate 
End Sub


Code:
Private Sub CbxCode_AfterUpdate() 
If Me.CbxCode.Column(1) = "Pending Affidavit" Then
      Me.noyears.Visible = True
Else
      Me.noyears.Visible = Flase
End If
End Sub
________
EASY VAPE VAPORIZER
 
Last edited:
a.sinatra said:
Have you tried an If statement?

Code:
Private Sub Form_Current() 
     Call CbxCode_AfterUpdate 
End Sub


Code:
Private Sub CbxCode_AfterUpdate() 
If Me.CbxCode.Column(1) = "Pending Affidavit" Then
      Me.noyears.Visible = True
Else
      Me.noyears.Visible = Flase
End If
End Sub

Hi, I placed the code and the behavior is the same as before.

Is a continous form so if a second value is selected all previous selections go invisible. I think the id record should be referenced somehow.

thanks

Dennis
 
Conditional formating is what you need if its continous forms, should work like a charm.

Not sure if you can hide it, but i believe you can disable it.
________
Ford del rey
 
Last edited:
a.sinatra said:
Conditional formating is what you need if its continous forms, should work like a charm.

Not sure if you can hide it, but i believe you can disable it.

Not sure how to do it

thanks

Dennis
 

Users who are viewing this thread

Back
Top Bottom