A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

comboboxes



 
 
Thread Tools Display Modes
  #1  
Old January 9th, 2010, 09:10 PM posted to microsoft.public.access.forms
thewabit via AccessMonster.com
external usenet poster
 
Posts: 54
Default 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  
Old January 10th, 2010, 02:07 AM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default 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  
Old January 10th, 2010, 04:37 AM posted to microsoft.public.access.forms
thewabit via AccessMonster.com
external usenet poster
 
Posts: 54
Default 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  
Old January 11th, 2010, 02:32 AM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.