Yes/No boxes and converting...

R

Redda

Hi all, first post. Got a bit of a problem. I am doing a register system
that can spot patterns for when people take time off. I have one pupil
with many weeks. Each week you mark when they were in. i.e. monday
lesson 1 (m1), monday lesson 2 (m2) e.t.c. upto monday lesson 6 (m6), i
also do the same for tuesday - friday. You can click the checkbox for
them being in and leave blank if not present.

Now the problem. I go to a query and click 'Sum'. This gives me a 0 for
an unchecked box, and -1 for a checked box. I want to know how i can
convert the -1, to a +1 so i can then add up all the m1's throughout
the week.

I am thinking this may have to be done in sql. I need to be told like a
kid as i have never used sql, expression builder or vb in access
before. So before giving me code, i really need to know what i am
using, i.e. a query, expression builder e.t.c.

Sorry if this seems very simple, but i have looked online for guides
and the access help files but not come across anything that is of any
help.

Much appreciate any help you can give me

thanks
Redda
 
G

Gary Miller

Redda,

Just mulitply your total by '-1' as two negatives will give
you a positive.

=Sum([m1])*-1

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
G

Gary Miller

Redda,

I don't believe that you can disable a control while it has
the focus. Try moving your focus to another control before
disabling it...

Private Sub cmdRemoveAll_Click()
...Remove all the stuffs from the list in the form...
' ***
Me![NewControlToGoTo].SetFocus
' ***
Me![cmdRemoveAll].Enabled = False <---- This doesn't
work
End Sub


--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
G

Gary Miller

Whoops, sorry. This was supposed to be a reply to a
different post.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Gary Miller said:
Redda,

I don't believe that you can disable a control while it has
the focus. Try moving your focus to another control before
disabling it...

Private Sub cmdRemoveAll_Click()
...Remove all the stuffs from the list in the form...
' ***
Me![NewControlToGoTo].SetFocus
' ***
Me![cmdRemoveAll].Enabled = False <---- This doesn't
work
End Sub


--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Redda said:
Hi all, first post. Got a bit of a problem. I am doing a register system
that can spot patterns for when people take time off. I have one pupil
with many weeks. Each week you mark when they were in. i.e. monday
lesson 1 (m1), monday lesson 2 (m2) e.t.c. upto monday lesson 6 (m6), i
also do the same for tuesday - friday. You can click the checkbox for
them being in and leave blank if not present.

Now the problem. I go to a query and click 'Sum'. This gives me a 0 for
an unchecked box, and -1 for a checked box. I want to
know
how i can
convert the -1, to a +1 so i can then add up all the
m1's
throughout
the week.

I am thinking this may have to be done in sql. I need to be told like a
kid as i have never used sql, expression builder or vb
in
access
before. So before giving me code, i really need to know what i am
using, i.e. a query, expression builder e.t.c.

Sorry if this seems very simple, but i have looked
online
for guides
 
Y

Yvonneb

In "Design Mode" on your current query - go to a new column - right click
and get the menu - click on "Build"
You should see a list of the fields in your current query - select the one
that gives you a -1 and double click. That should bring the field name into
the large text box

Now type * -1

If the value was 0 - it won't matter - if it was -1 it will now be +1

Now click "OK"

The name for that field will default to Expr1: - but you can type over
that - as long as you use a name that is not already a field in your query -
make sure you leave the colon after your field name - before the equation.

Good Luck!

ytb
 
Y

Yvonneb

In "Design Mode" on your current query - go to a new column - right click
and get the menu - click on "Build"
You should see a list of the fields in your current query - select the one
that gives you a -1 and double click. That should bring the field name into
the large text box

Now type * -1

If the value was 0 - it won't matter - if it was -1 it will now be +1

Now click "OK"

The name for that field will default to Expr1: - but you can type over
that - as long as you use a name that is not already a field in your query -
make sure you leave the colon after your field name - before the equation.

Good Luck!

ytb
 

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

Similar Threads

MS Access Query Design Question 0
Convert rows to columns 3
how to get the next monday? 4
Day of Week 3
Viewing series of appointments on one screen 1
DatePart Function 3
Get date for start of week 3
Lookup box 1

Top