Counting items and setting visible status of button

  • Thread starter Thread starter magickarle
  • Start date Start date
M

magickarle

Hi, I have a table "Value".
Sometime it has zeros and sometimes ones.
0
0
0

or
0
1
0
0

I have a form with button 1 and button 2.

In a Private Sub Form_Load(), I would like to count the number of
items in Value.
So if it has only zeros, it would display 1 and if it has seros and
one, it would display 2.
If the count is 1, I would like to set buton2.visible=false.
else button2=true
end if.

Thank you for your help as usual!!
 
By the way, "Value" is a sql reserved word, so maybe you ought to name your
table "tblValue".  Early on, I got in the habit of adopting naming
conventions on all the objects in my dbs, like frm for frm, rpt for report,
qry for queries, etc.

Damon







- Show quoted text -

Thank you for your reply!
Working A1.
thanks a bunch.

I got another question with the same previous example:
Would it be possible to rename the buttons based on the items value.
Ex:I got buton1 named buton1 and buton2 named buton2
I got item 0 and 1 (in the same table "Value" as previous example)
Thank you again
 
Back
Top