comboboxes

  • Thread starter thewabit via AccessMonster.com
  • Start date
T

thewabit via AccessMonster.com

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!
 
A

Arvin Meyer [MVP]

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
 
T

thewabit via AccessMonster.com

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!

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]
 
A

Arvin Meyer [MVP]

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 said:
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!

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top