Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    RuffianRan's Avatar
    RuffianRan is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    51

    Putting a Combo Box in the main field of a Form in Design View

    I'll start off by saying that this is out of a book for a college course. We have built a database for a Medical Clinic and went through these forms a couple 'Tutorials' back. I never got the Combo Box in the main form to work but didn't realize it until I went back to see how it was supposed to work when I was studying for my mid-term. Guess she missed that one. So, the instructions read:



    Position the Combo Box, select "I want the combo box to get the values from another table or query" --Next-- select "Query: qryPatientesByName" --Next-- select "Patient" and then "PatientID" --Next-- choose to sort ascending by "Patient" --Next-- re-size -- Next -- foreign key is "PatientID" --Next-- "Store that value in this field" option select "PatientID" --Next-- rename "PatientID".

    I'm attaching a copy of what we are up to now, after Tutorial 8. The Form I need help with is frmVISITSANDINVOICES. It's the only thing in caps.

    I haven't had the chance to look into this sooner because I've been working on my imaginary Equine Hospital database, trying to figure out what kind of queries, forms, and...haven't got to reports yet. How do you make up a business and then make up a complete database for it?!
    Attached Files Attached Files

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    The Combo Box wizard will do all of this for you.

  3. #3
    RuffianRan's Avatar
    RuffianRan is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    51
    Right, these are the steps through the Wizard. The problem is that when you go to Form View and click on a different client nothing happens. The Combo Box in the Header takes you to a different Visit like it's supposed to but the one in the main form does nothing.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    What do you expect the Combo Box in the Detail area to accomplish?

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    It looks like it will only change the patient's name.

  6. #6
    RuffianRan's Avatar
    RuffianRan is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    51
    I thought it was supposed to change the form to the selected patient's form. Otherwise, what's the point?

  7. #7
    RuffianRan's Avatar
    RuffianRan is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    51
    I just thought I must be doing something wrong somewhere and that was why it wasn't doing anything productive.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Quote Originally Posted by RuffianRan View Post
    I thought it was supposed to change the form to the selected patient's form. Otherwise, what's the point?
    I guess it was put there in case the original entry had the wrong patient!

  9. #9
    RuffianRan's Avatar
    RuffianRan is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    51
    All this Combo Box does is make it easier to change the name on the VisitAndInvoices Form, linking clients to the wrong medical information. You can't use the connected PatientID to type in anywhere on the current Form to go to that Patient's Form. Doesn't make any sense to me.

    In my Individual Case Study, where I created a database from scratch for an imaginary Equine Hospital, I have a Horses Form with similar Combo Boxes. The difference is that I didn't add them in Design View, they were already there from being in Lookup Fields in the Query I drew the Form from. I can change the Farm Name and the Gender Classification with the Combo Boxes but it doesn't change anything else on the Form. And I don't see why it would? There are multiple Horses per Farm, etc. So we come back to, "What's the point in adding this as a Combo Box?"

    It's nice that you can't change any info in a Report, but I want to show the info laid out like a Form without letting it be altered. This is very frustrating!

    oops...guess I was typing while you were replying

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    It looks like you called this thread as Solved. ComboBoxes are very useful and powerful if you know what you want to accomplish. Lookup Field on the other hand are a nightmare. They successfully hide what is really in the table. I don't use them as is the case with most developers.

  11. #11
    RuffianRan's Avatar
    RuffianRan is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    51
    Oh, is it not solved? I thought the decision was that there was no other reason for the Combo Box other than to allow the user to only type in a name already in the Database. I thought you meant that I was looking for something that wasn't there. I'll change it back to Unsolved until you say otherwise.

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    What do you want the ComboBox to achieve? Almost anything is possible.

  13. #13
    RuffianRan's Avatar
    RuffianRan is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    51
    Well, I looked back at the book and it doesn't really say. Really helpful ! So part of me wonders why I want to make it do anything. But that's just me.

    It just seems to me that if you're going to go to the trouble of putting a Combo Box in where you can only enter peoples names from the Database, no new ones, that by doing so the Form would then switch over the that person's Invoice. If you just change the Name you are actually changing the Name and PatientID connected to the InvoiceID for the whole Database. This should not be allowed! I checked it with another copy of the Database and does indeed change the order of the PatientIDs on the tblVisits.

    But your question was simply, "What do I want it to do?" I want the Form to switch over to the Patient's Invoice when you type that Patient's Name into the Combo Box.

    I want to know how to put more restrictions in a Form. I like the form layout but want the fixed fields in a Report. On the other hand, I don't think this is relevant to the class at all. But that's just me. ....and I always type too much, sorry

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Just so you know, you could add a new name with a ComboBox if that's what you wanted. It is called the "Not In List" event. I take iy you do NOT want this form to change the patient ID/ Name for this visit?

  15. #15
    RuffianRan's Avatar
    RuffianRan is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    51
    Right, I do not want to change the Patient ID/Name for the selected Visit ID. I want to pull up the Form with the Visit ID that is connected to the Patient ID on the Visits Table. After all, I am selecting the Patient ID, it should show me that Patient's information.

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

Similar Threads

  1. Replies: 9
    Last Post: 01-13-2015, 07:30 AM
  2. Replies: 6
    Last Post: 05-09-2014, 09:03 AM
  3. Replies: 5
    Last Post: 12-03-2013, 01:25 PM
  4. Replies: 8
    Last Post: 04-29-2013, 11:23 AM
  5. Replies: 8
    Last Post: 03-03-2013, 02:53 PM

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