Search results

  1. B

    Overlapping dates with some null data

    just for the records this seems to be doing the job Public Function CheckAdmissionOverlap(StartDate As Date, EndDate As Variant, StudID As Long, TableName As String, ByVal FormName As String, ByVal IDFieldName As String) As Boolean ' Function to check if there is an overlap with existing...
  2. B

    Overlapping dates with some null data

    it's tblCovid and frmCovid It's entirely like admissions in a hospital A studID can have an entry with startdate 1st Feb and no enddate. When someone tries to enter a new admission with startdate 15th Jan and enddate 20th Jan should be allowed to. They shouldn't be allowed though to enter an...
  3. B

    Overlapping dates with some null data

    thank you I've got the point but i'm struggling to handle my null data.
  4. B

    Overlapping dates with some null data

    hello people!! I have a tblCovid where essentially I keep hospital admissions (StudID, StartDate, EndDate). EndDate can be null if the Stud is already admitted what I'm trying to do is create a vba code which will prevent users from entering overlapping admissions. This how far I've come so far...
  5. B

    Avoid duplicate records (overlapping dates)

    would you mind explaining why you put a timerinterval on a few instances?
  6. B

    Avoid duplicate records (overlapping dates)

    hello again everything works fine apart from a small detail when editing records the warning box pops up as it recognises the record being edited overlapped by the new one (which are essentially the same) I could add a line excluding the current record from the function but this may create...
  7. B

    Solved Selecting data from combobox to be displayed on a subform

    Here is my db Thank you
  8. B

    Solved Selecting data from combobox to be displayed on a subform

    thank you that works well when navigating through records i want the subform though to change each time a value from the combobox is selected when creating a new record e.g.: when trying to create a new record. user selects employee3. subform shows employee3's leaves. then user selects...
  9. B

    Solved Selecting data from combobox to be displayed on a subform

    Hello all I have a tblEmployees (ID, EmpName), tblLeaveType (ID, LeaveName), tblEmpLeave (EmpID, LeaveID, StartDate, Dur) I have a split form for entering data on the tblEmpLeave (combobox EmpID + EmpName, combobox LeaveID + LeaveName, StartDate, Dur) I want to add a subform where all the leaves...
  10. B

    Avoid duplicate records (overlapping dates)

    that's the one! thank you very much!!
  11. B

    Avoid duplicate records (overlapping dates)

    thank you! I'm still getting an error though This time 2471, the expression you entered as a query parameter produced this error: EndDate And then it highlights the dcount line. I'm uploading the db if it helps
  12. B

    Avoid duplicate records (overlapping dates)

    thank you all! Below is my code I'm still getting an error on the same line Please note that there is no enddate on the form i'm using. it's enddate=dur-1 Don't know if this is what's causing the issue Function DiagOverlapExists(StartDate As Date, Dur As Long, DiagID As Long, StudID As Long) As...
  13. B

    Avoid duplicate records (overlapping dates)

    Hello everyone! I've been trying to use the code below (created by chatgpt essentially) I'm essentially trying to pop a msgbox (and not save) whenever there is a given DiagID for a given StudID on overlapping days e.g. diagID 1 for studID 1 on 10-15 Jan (dur 6 days) already exists. User is...
  14. B

    Many-to-many relationship?

    Thank you very much what’s the purpose though of the junction table ? I assume each SportsGroupID will appear once on the SportGrpMbr table? Otherwise there is a chance that a student will appear twice in the same sportsgroup on different records i am not interested in details about the...
  15. B

    Many-to-many relationship?

    Hi all I have a database that includes the following tables Students (firstname, lastname, ID, med_check) . Med_check is a date when each student last had a medical check (which is valid for 1 year). It may even be blank Sport_groups (ID, name, students.ID). Each sport group can contain more...
  16. B

    Dropdown list based on a query?

    Hi all I have a table that includes names of students. Duration of studies is 4 years and each year new students come in and others graduate. There is a table (students) with everyone's names, last names and unique IDs I have then created a query that runs every time I want to create a report...
  17. B

    PIVOT Tables

    thank you Actually my first query was fine I understand it may be long and messy but I essentially have zero experience What I did is I created a pivot table (using the wizard) based on my query1 TRANSFORM Sum(Query1.Expr3) AS SumOfExpr3 SELECT Query1.lastname, Query1.firstname FROM Query1...
Top Bottom