Do a totals query add the table to your query and include Studentname. Add another field to your query you could call it Number of subjects.
So in the field box put:
Number of Subjects: Studentname
select count for the total field
In the criteria put <14
The query will show all the students...
Add this field to your query:
Total: ([score1] + [score2] + [score3]) put sum in the total box in the query builder for this field. Look at the screenshot i've added if unsure.
in the datasheet view your query should look something like this:
ID_ score1_ score2_ score3_ Total...
In that case it may be best to base your form on a query (if you are not already doing so). Add all the fields that you need to the query and then add a another field in the field box add:
Total(or some other meaningful name): ([score1] + [score2] + [score3])
make your query a totals query by...
are you viewing the records as continuous forms? Is the total box in the form footer? If so putting this line in the form's current event may help:
me.requery
you would then see the total for the current record
you could alternatively add the line in the click event of the command button.
bang it in the 'control source' property of the text box - correct syntax is:
=sum([score1]+[score2]+[score3])
Rich
oh and for the counter something like this will do:
Static counter
Me.Textboxnamehere = Me.Textboxnamehere + 1
counter = Me.Textboxnamehere
End Sub
as you said you might...
Thanks,
I managed to delete that record and all related records in other tables. The table is now fine for data entry and there was no problem re-entering the record. I've got a back-up, but had made quite a few changes since the last back-up, so now everything is okay, i'll update the back-up...
I'm getting a write conflict in one particular field, whether I try and alter it in the Form or the table? I'm the only person using the DB, it was a shared file, but no-one else will be using it. I took off the sharing and it still won't update the field. Currently the field is storing #error...
It seems not as complicated as I thought. I built a crosstab with the wizard, it made me select a third field though, but I managed to modify it in design view to get rid of that field and modify another one. The final SQL was:
TRANSFORM Count(childinfo.HighestAIS) AS [The Value]
SELECT...
Hi Everyone! How are you all today?
I've been doing some queries and have cracked most of them, the last one's may have to be crosstabs, please take a look at this example:
________________________MAIS________________
CHILD RESTRAINT______0___________1_________>2
Infant carrier
Booster Cushion...
Managed to find a way to get the query to display exactly how I wanted with this SQL:
SELECT IIf([Highest AIS]>=2,2,[Highest AIS]) AS AISGroup, Count(childinfo.[Highest AIS]) AS [Number], Count([childinfo].[Highest AIS])/(SELECT
Count(*) FROM childinfo) AS [Percent]
FROM childinfo
GROUP BY...
if me.yourcheckbox = "yes"
exit sub
else
If MsgBox("Are you sure you want to archive?", vbYesNo + vbQuestion, "Archive?") = vbYes Then
do what you've got to do
else
me.yourcheckbox = "no"
me.requery
end if
end if
HTH
I've come up with a solution of sorts.
In the form footer i've done a dcount of all AIS's with 2 or higher. I altered my original query to just pick-up AIS of less than 2, so there are two lines on the continuous form.
Problem is that I have a gap between the last row and the textbox and label...
Hi Peops,
I want to display info like this as a continuous form.
Highest AIS Total Percentage
0
1
>+2
Highest AIS can be up to 9. I don't reckon i'll be able to do a count of all >=2 on one record of a query.
Thanks to some help I have done similar queries but the >=2...
Thanks that worked well. I had to manipulate the percentage column slightly i.e. make it 100* bigger - here's the SQL
SELECT P.childposition, Count(P.childposition) AS [Number], Count([P].[ChildPosition])/(SELECT
0.01*Count(*) FROM childinfo) AS [Percent]
FROM...
Hi,
Someone has asked me to do a bunch of queries I thought they looked easy and they might be, but i've got stuck.
most of the queries are of similar style, i'd like the output to be like this:
[Child Position] [Number] [Percentage]
Front Passenger
Rear-Right
Rear Centre
Rear Left
Unknown...
I've got five similar fields where I want to use the same code for the keypress. Instead of pasting the same code 5 times i'd like to call another sub, but whatever I try I get variable not defined or argument not optional
Private Sub AIS3_KeyPress(KeyAscii As Integer)
Call...
put something like this in the before update event for the text box
If Len(Me.text) <> 4 or IsNumeric(Me.text) =False Then
MsgBox "Length > 4 or not digits", vbExclamation, "invalid entry"
Cancel = True
End If
Thanks for the suggestions, the concatenation would do the job I didn't think of that.
I was trying to use an unbound textbox for the other and have done it successfully in another form, but as this is a subform the unbound textbox will display the same value for every record i.e.
Make...
Hi peops,
I know how to let the user see multiple columns in a dropdown by setting columns widths likes so:
5cm;4cm etc... and also changing column count
but after the user makes a selection how do I get both columns to still show in the combo box
thanks
thanks Pat,
got it doing exactly what I want now. I can use this in some of the other forms too. I've been handed this db and it's in a right state - normalisation not done properly/at all