If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
comboboxes
I have a combo box that uses a value list as it's row source type. The
options in it are 1, 2, 3, or 4. I want have one of these items to automatically populate this combobox depending on what is selected in a box called "Comments". The "Comments" combobox is based on a query with a SQL of: SELECT tblComments. Comments, tblComments.CmntAreaCode, tblComments.CommentID FROM tblComments WHERE (((tblComments.CmntAreaCode)=Forms!frmObservations !frmLO_Details.Form! CmntAreaCode)) ORDER BY tblComments.CmntAreaCode; Each comment has a unique ID in this tblcomments, would I use that to filter? Thanks! -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
comboboxes
If there's a direct correlation between the data, you may not really need to
store the value in the combo. That said, use the AfterUpdate event of the first combo to find the value in a Select Case statement: Private Sub Combo1_AfterUpdate() Select Case Me.Combo1 Case "Comment Whatever" Me.Combo2 = 1 Case "Another comment" Me.Combo2 = 2 '... etc. End Select End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "thewabit via AccessMonster.com" u57141@uwe wrote in message news:a1dea58734219@uwe... I have a combo box that uses a value list as it's row source type. The options in it are 1, 2, 3, or 4. I want have one of these items to automatically populate this combobox depending on what is selected in a box called "Comments". The "Comments" combobox is based on a query with a SQL of: SELECT tblComments. Comments, tblComments.CmntAreaCode, tblComments.CommentID FROM tblComments WHERE (((tblComments.CmntAreaCode)=Forms!frmObservations !frmLO_Details.Form! CmntAreaCode)) ORDER BY tblComments.CmntAreaCode; Each comment has a unique ID in this tblcomments, would I use that to filter? Thanks! -- Message posted via http://www.accessmonster.com |
#3
|
|||
|
|||
comboboxes
Here is a little more information.
My tblcomments looks like this: commentID comment otherstuff Severity 1................blahblah...................2 2.................blahblah..................1 3.................blahblah..................3 Would there be any way to do what you are saying using the "CommentID" column in the table? Thanks! Arvin Meyer [MVP] wrote: If there's a direct correlation between the data, you may not really need to store the value in the combo. That said, use the AfterUpdate event of the first combo to find the value in a Select Case statement: Private Sub Combo1_AfterUpdate() Select Case Me.Combo1 Case "Comment Whatever" Me.Combo2 = 1 Case "Another comment" Me.Combo2 = 2 '... etc. End Select End Sub I have a combo box that uses a value list as it's row source type. The options in it are 1, 2, 3, or 4. I want have one of these items to [quoted text clipped - 13 lines] Thanks! -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201001/1 |
#4
|
|||
|
|||
comboboxes
Actually, you will not need to store anything twice. Just store the
CommentID and link the tblcomments to the table you are storing the CommentID in a query. Examples of how to do this are in Crystal Long's tutorials: http://www.accessmvp.com/Strive4Peace/Index.htm -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "thewabit via AccessMonster.com" u57141@uwe wrote in message news:a1e28e23fe3f5@uwe... Here is a little more information. My tblcomments looks like this: commentID comment otherstuff Severity 1................blahblah...................2 2.................blahblah..................1 3.................blahblah..................3 Would there be any way to do what you are saying using the "CommentID" column in the table? Thanks! Arvin Meyer [MVP] wrote: If there's a direct correlation between the data, you may not really need to store the value in the combo. That said, use the AfterUpdate event of the first combo to find the value in a Select Case statement: Private Sub Combo1_AfterUpdate() Select Case Me.Combo1 Case "Comment Whatever" Me.Combo2 = 1 Case "Another comment" Me.Combo2 = 2 '... etc. End Select End Sub I have a combo box that uses a value list as it's row source type. The options in it are 1, 2, 3, or 4. I want have one of these items to [quoted text clipped - 13 lines] Thanks! -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201001/1 |
Thread Tools | |
Display Modes | |
|
|