Results 1 to 3 of 3
  1. #1
    Raveen1609 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    53

    In datasheet view of forms, duplicate records

    Hi, I have a bsic knowledge in Access. I am creating a small database for Doctor appointment. I have a form viewing in datasheet view, with field ApptDate and ApptTime (Drop down list of times). and a doctorName field and PatientName field



    Now I want to avoid duplicating the all the 3 values. For the same date, already selected time and doctor name should not be accepted. Either a popup message or the previously selected time value shouldnt be there in the drop down list. Also dont want the patientName not repeat for the same date.

    Kindly give advise, on how to overome this problem.

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    key the table to prevent duplicates, and date/time should be 1 single field (don't make 2 fields ,BUT you can show 2 boxes ; 1 for date , 1 for time yet 1 field.) :

    ApptDate*
    PatientID*

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    In addition to ranman's suggestions you need to lookup Cascading combo-boxes in this forum and in general on the web, there are many examples around. Basically you need to edit the row sources of the doctor and patient to eliminate those already booked for that date and time (by using a left outer join - see example by creating an "unmatched" query using the query wizard.
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Opening Single Records from Datasheet View
    By pdowg881 in forum Access
    Replies: 7
    Last Post: 04-17-2015, 11:35 AM
  2. Replies: 4
    Last Post: 05-12-2014, 12:24 PM
  3. Replies: 3
    Last Post: 08-18-2013, 09:14 PM
  4. Replies: 2
    Last Post: 05-15-2013, 09:03 PM
  5. Replies: 6
    Last Post: 11-21-2012, 05:10 PM

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