visible controls

  • Thread starter samotek via AccessMonster.com
  • Start date
S

samotek via AccessMonster.com

Visible controls

In my form the code for making controls visible and invisible does not work.
My code is the following:
Private Sub Form_Current()
If Me![supplierid] = 1 Then
Me.RaufGrade.Visible = False
Me.RaufCode.Visible = False
Me.AralGrade.Visible = True
Me.AralCode.Visible = True
ElseIf Me![supplierid] = 2 Then
Me.AralGrade.Visible = False
Me.AralCode.Visible = False
Me.RaufGrade.Visible = True
Me.RaufCode.Visible = True
End If
End Sub

Why is it so? Is it because the form is continous? How can I make it work?
 
A

Al Campagna

samotek,
This code looks OK if SupplierID is numeric...

What does "not work" mean? No error message?

Where do you have this code?
On the Current of the Main (if any), or the Current of the Subform?

Did you Cut & Paste it exactly as you have it?

Where is SupplierID? Main? Subform?
Please give a little more detail about your form setup, and details
about
your important form fields and records.

Just a suggestion... usually, any field name with ID relates to a key
unique
field, like CustID, CompanyID, EmployeeID, etc...
Sounds like SupplierID is more of a "SupplierType". Definitely not a
rule
at all... just a "style" thing. Totally your call...
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
L

Linq Adams via AccessMonster.com

Since the form is ***Continuous*** the controls are going to either be
visible or not visible ***depending on the value of SupplierID in the current
record*** and this will reflect on ***all records*** in the form. That's the
way things work in Continuous orDatasheet forms.

With these kinds of forms you have to use Conditional Formatting off of the
Format Menu to do formatting. WHile you cannot set the control to
visible/invisible using CF, you can diddle it so that the forecolor is the
same as the back color under certain conditions, essentially making it
"invisible,".
 

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