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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking CombBoxs on a form?? Nothing makes sense!!

Status
Not open for further replies.

DouglasLB

Technical User
Jun 18, 2001
10
0
0
US
We have been trying to follow the instructions on other threads on linking comboboxes so the choice in the first box determines the choices available in the second combobox.

ComboBox 1 is called ListeningPost and the columns in the table are ListeningPost and LPidentifier. The second ComboBox is called FeedbackSource and the columns are FeedbackSource and LPidentifier.

My form is called IssueEntry.

The tables are named TblListeningPost and TblFeedbackSource.

How should the Row source Property be written for each combobox and how should "after update" event in combobox 1 be written.

Thanks inadvance for all the wonderful Help we are about to receive!!!!

 
ListeningPost_AfterUpdate Sub

FeedbackSource.RowSource = "SELECT DISTINCT FEEDBACKSOURCE FROM TBLFEEDBACKSOURCE WHERE LPIDENTIFIER = " & ListeningPost.Column(1)

End Sub

Here are some things to consider...

1. Combobox2's RowSourceType must be set at Table/Query
2. Column Count of ComboBox1 must be set at 2.
3. If LPidentifier is a text field (alpha/num) then you must put tick marks in the WHERE clause like so...

FeedbackSource.RowSource = "SELECT DISTINCT FEEDBACKSOURCE FROM TBLFEEDBACKSOURCE WHERE LPIDENTIFIER = '" & ListeningPost.Column(1) & "'"

Hope this helps. ljprodev@yahoo.com
ProDev
MS Access Applications
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top