Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441

    What button do I need to click to get to the form you are working on, I will pare down the database and post a sample for everyone else to look at as well.

  2. #17
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    ok I think I found it

    just the 'schedule' button

    Just curious here. This seems like an overly complex design, are you married to it?

  3. #18
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    EDIT: if anyone else wants a copy of the database I can forward one through email but because of the design I can't get it under 500k without destroying parts that might be relevant.

    I haven't noticed any problems with your data structure but your user interface more complex than it needs to be.

    For instance, just on your frmSchedule you have:

    1. The form with the crosstab in it (the 'main' form for the purposes of your example)
    2. A form to add a new scheduled item (frmAddNewAppointment/frmAddNewAppointmentsubform)
    3. A form to find a scheduled item (frmFindAppointments)
    4. A result form (2 of them) for the find scheduled item (frmFindAppointmentResultsWithoutLocation/frmFindAppointmentResults)
    4. A form for unscheduled appointments (frmUnscheduledAppointments)
    5. A form to edit appointments (frmEditAppointment)

    All of which have something to do with the table tblSchedule and all of them on bound forms. All of these are supported by queries in your database window. I'm not sure what's chewing up space in your database the smallest I could get it was 4.4 meg before zipping it so I don't know that I can upload it either because of the complexity of having multiple forms all referencing the same table I have to include them. The smallest I could get it with all the objects included was 853kb with 7-zip.

    All of these functions I'm fairly certain could be done on a single form using unbound controls and your users wouldn't have to go from form to form to form. The reason I'm bringing this up is that your original question was to prevent your database from allowing overlapping schedules but that function is not actually performed on the form you put a screen shot of. It's actually done on either frmAddNewAppointment or frmEditAppointment (maybe other places as well, it's hard to wade through your logic on all these forms to get an idea of what you were trying to do).

    If you want to keep this structure mostly intact, I would put the overlapping span check on frmEditAppointment or frmAddNewAppointment and instead of having the employees be a subform have it be an unbound control with a list box and on your 'save' button relating to adding an employee check the span of the appointment against any others for that same employee.

  4. #19
    Aweiher is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    25
    owe, I am kind of married the design. But I say that mostly because I would rather not incorporate this feature then reformat the design. You bring up a valid point about having the overlapping span check on the forms frmEditAppointment and frmAddNewAppointment. What kind of code would check to see if the span of the appointment against existing ones of the same employee? I don't even understand how that can be accomplished because the database for example might know that Employee X is starting an appointment at 8:00am, and will be done at 11:00am, but doesn't know that the employee is busy at 8:01am, 8:02am, etc.

    If you can put me on the right path to write the code that can check the span of two times then I can probably take it from there, otherwise I may give up. Either way I want to thank you for all of the effort you've put into this.

  5. #20
    sstiebinger is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2015
    Posts
    105
    Compare the new appointment against any found records.

    So you create a new appt for John Smith.
    You look for existing records for john smith for that day, and for each you check if the current appoint is within the same start/end time, the example from the baldyweb link would work for this.
    If the new record isn't within the bounds, then create the new record.

  6. #21
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    I am struggling with this because you have some odd things happening in your forms, I am stripping it down to the tables and an example unbound form that will perform a check on a new appointment request I am not dealing with your current forms at all, they are too cumbersome. You really should not start to lock down your database in terms of functions (closing windows, pop-up/modal, etc) before your database is functioning correctly otherwise you get all kinds of problems when trying to perform edits.

    I'll try to have something out to you later today

  7. #22
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    Example database using an unbound form

    aweiher_modfied.zip

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 10-30-2014, 12:31 PM
  2. Replies: 1
    Last Post: 08-19-2011, 02:53 PM
  3. Compare Two types of records from one table
    By pstrahan in forum Access
    Replies: 1
    Last Post: 08-10-2011, 11:22 AM
  4. Access compare and sum records in two tables
    By piszczel in forum Queries
    Replies: 8
    Last Post: 05-23-2011, 02:07 AM
  5. Compare records in 2 tables
    By RalphJ in forum Access
    Replies: 13
    Last Post: 03-06-2011, 07:43 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums