Results 1 to 10 of 10
  1. #1
    AdiDoyle is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Ireland
    Posts
    23

    Date Entry Form, enter multiple records at once

    I'm not sure if this is possible, but I'd really appreciate if someone could let me know.

    I have a data entry form for a table, Appointment. The data that goes into this includes Doctor_ID, Patient_ID, Appointment_Date, and Appointment_Timeslot.



    Some patients will require multiple appointments, but it would be tedious to repeatedly put in the Doctor and Patient information for, say, six appointments. Is it possible to use one data entry form to input multiple records at once, whereby I could select the Doctor_ID and Patient_ID once, but input multiple separate dates and times, then save all of these records in one go?

    If not, is there any way to auto-fill the fields of a new record with the information which was submitted into the last record saved? Eg, when I click "save appointment" a macro would both save the information for that record, and insert it into the fields of a new record, so all I would have to do is enter the date and time of the next appointment before saving that too.

    It would be great to hear any solutions to this problem. Thanks in advance.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    I think your table design might be improved. Google "access many to many" and have a read.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    AdiDoyle is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Ireland
    Posts
    23
    Hi Bob,

    Thanks for the suggestion. I should have probably mentioned that the patient and doctor IDs are foreign keys to separate tables. I have the whole DB in 3NF as far as I can tell, and I don't think there's anywhere I need to add an assign table to deal with a many to many relationship.

    Maybe I'm missing something, but how would an issue with a many to many relationship between my tables affect the functionality of a form?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Post a jpg of your tables and relationships. Perhaps you could show readers some code to clarify the issue, or a sample of your data showing what you are dealing with; what you expect and what you are actually getting.

  5. #5
    AdiDoyle is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Ireland
    Posts
    23
    Hi Orange.

    Here is a jpeg of my tables and their relationships. As you'll see it's a very simple database.

    Click image for larger version. 

Name:	Relationships.jpg 
Views:	30 
Size:	70.2 KB 
ID:	29299

    Here is a jpeg of my the form (also very rudimentary):

    Click image for larger version. 

Name:	Form.jpg 
Views:	29 
Size:	44.9 KB 
ID:	29300

    What I'm trying to get it to do is this. Say I enter values into each of the 6 fields and click save. Can I write a macro that will not only save the data to a record in the appointments table, but also open a new blank version of the form AND auto-fill the information I've just inputted for the last record into the first four fields (Patient, Eye, Doctor, Drug)? This would save me inputting this information every time I want to book a single appointment for the same patient.

  6. #6
    AdiDoyle is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Ireland
    Posts
    23
    Also, I just realised I misspelled the title of this thread. I meant to call it Data Entry Form... Mea Culpa

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Where does Eye fit into your business/model?

    Would you not also have a dosage for the Drug and/or a prescription?
    Sometimes it's easier to describe a typical day in the business in simple English to test/vet your data model.

    There are generic data models as DatabaseAnswers.org

    Here is one, and the business requirements/facts that may be of interest to you
    http://www.databaseanswers.org/data_...ctor/index.htm

  8. #8
    AdiDoyle is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Ireland
    Posts
    23
    This is a basis for a database to be built for an ophthalmologist, so the eye is a short text field. It can be either left or right.

    The dosage is particular to the type of drug being used.

    I don't think the data model is the issue here. I realise it's simple, but it fits the purpose that was described to me. There is no need for a many-many relationship between the Drug and Appointment table, because there will only ever be one drug per appointment.

    I really just need to know if there's a way to auto-fill fields in the data entry form using information from a previous record. I know I made a mess of explaining that, so my apologies for the confusion. And thanks for all your assistance so far.

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Well keeping things real simple, you might consider using a tempvar(s) to record the data you're concerned with. You put the data value(s) into the Tempvar(s) and you can use the Tempvar(s) to put the latest data into the table field.

    If it's a common value for all records you could review this
    http://access.mvps.org/access/forms/frm0012.htm

    See this post and link by pbaldy re previous values
    https://www.accessforums.net/showthr...0325#post50325

    Good luck.

  10. #10
    AdiDoyle is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Ireland
    Posts
    23
    Tempvars were exactly what I was looking for.

    Thanks very much!

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

Similar Threads

  1. Entry of multiple date fields in form
    By jegunn in forum Forms
    Replies: 3
    Last Post: 04-02-2015, 02:31 PM
  2. Replies: 12
    Last Post: 02-19-2014, 11:01 AM
  3. Form Entry (Enter a quanity of record)
    By spartanx117 in forum Forms
    Replies: 3
    Last Post: 10-03-2013, 01:54 PM
  4. Replies: 11
    Last Post: 06-19-2012, 01:08 PM
  5. Replies: 0
    Last Post: 07-26-2010, 07:34 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