hey Guys,
I've run into a stumper and was hoping someone could smack me in the back of the ehad and get me going.
I have a table, called "tblStores" and in it, there are two fields; "strStoreID" and "strStoreLocation". strStoreId is set to primary key since there will never be a duplicate store ID. There is only one store ID and only one location per store ID.
On my form, I have a combobox, "cboStoreID" where I select what store ID I need. Next to it, I have a list box, titled "txtStoreLocation". This txt box never gets focus, nor is ever typed in or anything. Its sole purpose, is to automatically fill in the store location that is a match to the combobox's store ID, based on the table "tblStores" data.
No matter what I do, I cannot get the list box to display the store location.
The Row Source code for "cboStoreID":
SELECT tblStores.strStoreID
FROM tblStores
ORDER BY tblStores.strStoreID;
The After_Update event for this has:
Private Sub cboStoreID_AfterUpdate()
txtStoreLocation.Requery
End Sub
The Row Source code for "txtStoreLocation" listbox:
SELECT tblStores.strStoreID, tblStores.strStoreLocation
FROM tblStores
WHERE (((tblStores.strStoreLocation)=[Forms]![frmDataEntry]![cboStoreID]))
ORDER BY tblStores.strStoreID;
Is there something I am missing? Would I be better off using a text box instead of a list box?
Thanks guys!!
I've run into a stumper and was hoping someone could smack me in the back of the ehad and get me going.
I have a table, called "tblStores" and in it, there are two fields; "strStoreID" and "strStoreLocation". strStoreId is set to primary key since there will never be a duplicate store ID. There is only one store ID and only one location per store ID.
On my form, I have a combobox, "cboStoreID" where I select what store ID I need. Next to it, I have a list box, titled "txtStoreLocation". This txt box never gets focus, nor is ever typed in or anything. Its sole purpose, is to automatically fill in the store location that is a match to the combobox's store ID, based on the table "tblStores" data.
No matter what I do, I cannot get the list box to display the store location.
The Row Source code for "cboStoreID":
SELECT tblStores.strStoreID
FROM tblStores
ORDER BY tblStores.strStoreID;
The After_Update event for this has:
Private Sub cboStoreID_AfterUpdate()
txtStoreLocation.Requery
End Sub
The Row Source code for "txtStoreLocation" listbox:
SELECT tblStores.strStoreID, tblStores.strStoreLocation
FROM tblStores
WHERE (((tblStores.strStoreLocation)=[Forms]![frmDataEntry]![cboStoreID]))
ORDER BY tblStores.strStoreID;
Is there something I am missing? Would I be better off using a text box instead of a list box?
Thanks guys!!