Recent content by kate10123

  1. K

    Select Distinct vs. Group By

    Hi Guys, I am trying to get a distinct count of students that have had tutorials and group this by the department they are in. At the moment I am using the query below but this seems to count the total number of students in the tutorial table and not just pick out the distinct ones. SELECT...
  2. K

    Just added a field and now query is over calculating!

    Thanks that worked really well. I am having a similar problem with the SQL statement below: SELECT Count(*) AS Students FROM (SELECT DISTINCT StudentID FROM tbl_Tutorial) AS T, tbl_Tutorial WHERE (((tbl_Tutorial.Date) Between [Forms]![frm_Dates]![txtFrom] And...
  3. K

    An append query based on data in an excel list?

    Hi, I imported the excel table into my database called 'tbl_Enrolments' Then I tried to create an UPDATE query but am not sure on the correct syntax. I want to update the field called 'course' in table 'tbl_Student' with a corresponding match in tbl_Enrolments WHERE the studentID matches.
  4. K

    An append query based on data in an excel list?

    Thanks I will give that a try :)
  5. K

    Just added a field and now query is over calculating!

    Hi there, I am using a query to get a rough count of how many students have had more than one tutorial. This was working fine until I put a WHERE clause to add a 'TO' and 'FROM' date statement. Here is my SQL: SELECT Count(vTbl.StudentID) AS StudentsMore FROM (SELECT StudentID FROM...
  6. K

    An append query based on data in an excel list?

    Hi there, I have a table called tbl_student with student ID and several other fields. I have recently received an excel spreadsheet with a list of student IDs and their courses. How would I go about running an append/update query to update each student with no course if they exist in the...
  7. K

    Me.Filter and make records appear in descending order?

    Hi there, I have a student form which is used to enter data about students. I have added a couple of filter buttons so it is easier for the admin team to find blank fields to carry on entering data. Ideally though, I want the filter to also show the records in descending order by created_date...
  8. K

    DISTINCT and COUNT together?

    Hi there, I am trying to write a query to count the number of distinct students that belong to each faculty and a gender breakdown of this. My query is as follows: SELECT distinct Count(tbl_Tutorial.StudentID) AS CountOfStudentID, tbl_Student.Faculty, tbl_Student.M_F FROM tbl_Student INNER...
  9. K

    Combo box and then fill textboxes

    Thanks for all the responses. I have got it working thanks to all your help! :)
  10. K

    Combo box and then fill textboxes

    Hi there, I am using a combo box with a control source consisting of a query of these fields: Course Faculty Department I have two textboxes called 'faculty' and 'department'. The way it should work is as follows: The user selects a course from the dropdown list, the corresponding...
  11. K

    Automation object error

    This line is highlighted after debugging the error Forms!frm_tutor!Tutorial.Form!StudentID = Me.QuickSearch.Column(2)
  12. K

    Automation object error

    Thanks for replying. No Quicksearch.column(2) is referring to the third column in the list.
  13. K

    Automation object error

    it is a listbox
  14. K

    Automation object error

    Hi All, Attached is a screenshot of an error message that seems to occur sometimes but then at other times it works fine. It happens on searching for a student and trying to click on a result to transfer the text to a form. The code I am using is as follows: Private Sub...
  15. K

    on entering a number in a textbox, check if entry already exists?

    Hi All, Sorry for the delay in replying. The StudentID was defined as a number in the underlying table and the code kindly provided by Denniskworked well! Dim iStudentID As Long 'the primary key of the student table iStudentID = Nz(DLookup("[iStudentID ]", "tblStudent", _...
Back
Top Bottom