Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rowsource issue?

Status
Not open for further replies.

dab1477

Technical User
Mar 4, 2011
33
US
Thanks in advance. I have a form with the field AREA where I can select from two choices (Handset or Polymer) in a drop down combo box. This same form also has another combo box titled Location. I want the choices in the LOCATION box to be dependent upon the selection in the AREA combo box. For instance... If I select "HANDSET" from the two selections offered in the AREA combo box, I want the LOCATION combo box to offer me selections from a query that sorts ONLY the locations associated with Handset. I have the lists for LOCATION saved as separate tables. I have a Handset Location table and a Polymer Location table. In addition, to assure that I get an alphabetical listing, I created queries that sort and present the Location tables in Ascending alpha order. I think I need code as follows:
Private Sub Location_Enter()
Dim strSql1 As String
Dim strSql2 As String

strSql1 = "qry_HandsetLocationALPHA"
strSql2 = "qry_PolymerLocationAlpha"

If Me.AreaID.Value = "Handset" Then
Me.Location.RowSource = strSql1
ElseIf Me.AreaID.Value = "Polymer" Then
Me.Location.RowSource = strSql2
Else
End If

End Sub
Code does not work.
The table value of Location is TEXT. I'm stuck on how to make this happen. If I choose HANDSET in the AREA filed, I want to be able to select from one of 8 locations in qry_HandsetLocationALPHA (and if I select POLYMER I want to select from qry_PolymerLocationAlpha)and have that value save to my table under LOCATION column.

Need direction please. Thanks
 

hi,

Seems this might be MS Access forum705

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
If you post elsewhere, please explain what you mean by "Code does not work" and tell us what you have done to troubleshoot. Check out faq705-7148 for some troubleshooting tips.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top