Here's where VBA would go:
http://www.baldyweb.com/FirstVBA.htm
Here's where VBA would go:
http://www.baldyweb.com/FirstVBA.htm
I only have the Location's primary key in the DoctorT
This is the part I think I'm doing wrong. I just keep getting errors saying "Access cannot find the object 'me.'". Not sure if this has something to do with Access2016 or if I'm just doing something wrong. Is there a requery expression I can build?
is Doctor the name of the combo box? Both combo boxes(Locaation and Doctor) are on the same form right?
Also if you are not familiar with the build option, it is great at giving you the correct syntax to use for forms, fields, options, etc. Open your main form in design, now open a query(new or existing), in the criteria box of a column, right click and select Build, double click Forms, double click Loaded Forms, double click your form(subform also), you wll see fields and options show up. If you double click on a field, at the top it will show you the full path to that field that you can use in your code. You can also see on the right all the properties you can choose or double click also.
SOLVED:
Thanks to pbaldy and Bulzie for all the help and guidance. I was able to get everything working by doing the following
Added Lookup Column field (LocationLookup) to populate the Location that the user wants from LocationT.LocationName. This field also contains the other columns which the user will need to see. On the Property Sheet, I set the Column Count to the number of columns I added and changed the Column Widths to 0" for all but the LocationName. I then added text boxes for the rest of the columns I wanted displayed using function "=LocationLookup.column(x)".
Added Combo Box field (DoctorLookup) to populate the Doctors which relate to the selected location from DoctorT.DoctorName. Added additional columns as noted above in LocationLookup.
In order to get the DoctorLookup combo box to only display the doctors at a given location I set a criteria for DoctorT.LocationID (autonumber from LocationT) field to [PatientT].[LocationID]. I then added the requery to the After Update event at the LocationLookup in order to update the query based on the selected location.
This requery popped my VBA cherry: Me.DoctorLookup.Requery
Doing all this I was able to accomplish everything I was looking to. Big thanks again to the members in this forum.
One sort of strange issue arose as a result of all this though. Now when I filter any column on the split form I get an error "The method you tried to invoke on an object failed". The filter works fine after I hit "OK" but it's still strange that the error is getting thrown. I do not get the error in the table, only the form. I've done a little research on what causes this but no luck yet.