B
Brian Beck
I have a form (fIncidentReport) in which the user first selects their
district from a combobox (DistrictComboBox). This then auto-populates the
Campus field with a listing of all the campuses that are in that district.
I've figured this coding and it's working very well, but now my problem is
getting this scenario to work with a text box instead of a combo box.
I have a field on the form that is a text box and it will have the name of
the superintendent (SuperintendentFullName) for the district that was
selected in the DistrictComboBox. Now, if I were to make this a combo box
instead, I could easily have it auto-populate with the superintendent's name
by creating a query (qSuperintendent) with the following code:
SELECT tOrgDistrict.CountyDistrictNum, tOrgDistrict.SuperintendentFullName
FROM tOrgDistrict
WHERE
(((tOrgDistrict.CountyDistrictNum)=[Forms]![fIncidentReport]![DistrictComboBox]));
and then using the following code in the SuperintendentFullNameComboBox on
the form:
SELECT qSuperintendent.SuperintendentFullName
FROM qSuperintendent;
Now this works just fine, except for 2 things.
1. The superintendent's name doesn't automatically show up in that field on
the form. The user has to manually enter that field (either by tabbing to
it or with the mouse) and then select the superintendent's name from the
drop down box. True, there is only going to be one name there, but the user
still has to go select it.
2. This really shouldn't be a combo box because this field will only ever
have one value...there is never going to be a combination of
superintendent's for the user to select from.
What I'm wanting then is to be able to populate the text box (let's call it
SuperintendentTextBox) with SuperintendentFullName and allow the user to
either see it, know that it is correct and move on, or to see it, realize
it's wrong and then type in the correct information in that same text box.
Then, when the record is submitted to the database table (tIncident), the
correct SuperintendentFullName will be put there, not the one that was
pulled from tOrgDistrict.
Sorry for being so lengthy, I just wanted to make sure I gave as much
information as possible. I'm doing this in Access 2003 on Windows XP Pro.
Any help would be greatly appreciated.
Thanks.
-Brian
district from a combobox (DistrictComboBox). This then auto-populates the
Campus field with a listing of all the campuses that are in that district.
I've figured this coding and it's working very well, but now my problem is
getting this scenario to work with a text box instead of a combo box.
I have a field on the form that is a text box and it will have the name of
the superintendent (SuperintendentFullName) for the district that was
selected in the DistrictComboBox. Now, if I were to make this a combo box
instead, I could easily have it auto-populate with the superintendent's name
by creating a query (qSuperintendent) with the following code:
SELECT tOrgDistrict.CountyDistrictNum, tOrgDistrict.SuperintendentFullName
FROM tOrgDistrict
WHERE
(((tOrgDistrict.CountyDistrictNum)=[Forms]![fIncidentReport]![DistrictComboBox]));
and then using the following code in the SuperintendentFullNameComboBox on
the form:
SELECT qSuperintendent.SuperintendentFullName
FROM qSuperintendent;
Now this works just fine, except for 2 things.
1. The superintendent's name doesn't automatically show up in that field on
the form. The user has to manually enter that field (either by tabbing to
it or with the mouse) and then select the superintendent's name from the
drop down box. True, there is only going to be one name there, but the user
still has to go select it.
2. This really shouldn't be a combo box because this field will only ever
have one value...there is never going to be a combination of
superintendent's for the user to select from.
What I'm wanting then is to be able to populate the text box (let's call it
SuperintendentTextBox) with SuperintendentFullName and allow the user to
either see it, know that it is correct and move on, or to see it, realize
it's wrong and then type in the correct information in that same text box.
Then, when the record is submitted to the database table (tIncident), the
correct SuperintendentFullName will be put there, not the one that was
pulled from tOrgDistrict.
Sorry for being so lengthy, I just wanted to make sure I gave as much
information as possible. I'm doing this in Access 2003 on Windows XP Pro.
Any help would be greatly appreciated.
Thanks.
-Brian