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  

cascading comboboxes and textbox



 
 
Thread Tools Display Modes
  #1  
Old January 9th, 2008, 07:36 PM posted to microsoft.public.access.forms
SteveP
external usenet poster
 
Posts: 33
Default cascading comboboxes and textbox

I have a form with some comboboxes and text fields. The comboboxes I am
working with are called cboItem and cboDescription. The main text field I am
working with is called txtStandardCost. Right now, I have it as two
cascading comboboxes and a text field that I have to manually enter the
Standard Cost into. As much as I would love to make the cboDescription into
a text field, I want users to have the option of picking the description and
having the cboItem fill in with any correlating Item #s (company was
purchased by a larger company...still have 2 inventory management systems and
2 different numbering systems). My problem/question is how do I get the
txtStandardCost field to fill in automatically when the cboItem is filled in
while still having the cascading combobox effect still work? Field
names/order in the table is ID, Item, Description, StandardCost. Thank you
in advance for any and all help.

  #2  
Old January 9th, 2008, 07:56 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default cascading comboboxes and textbox

Hi Steve,
something like this:
in after update for cboItem
me.txtStandardCost = me.cboItem.Column(1)

use whichever column in the cboItem has the standard cost in
me.txtStandardCost = me.cboItem.Column(1)

combo column numbering starts at 0, so the first column is Column(0)

Jeanette Cunningham


"SteveP" wrote in message
...
I have a form with some comboboxes and text fields. The comboboxes I am
working with are called cboItem and cboDescription. The main text field I
am
working with is called txtStandardCost. Right now, I have it as two
cascading comboboxes and a text field that I have to manually enter the
Standard Cost into. As much as I would love to make the cboDescription
into
a text field, I want users to have the option of picking the description
and
having the cboItem fill in with any correlating Item #s (company was
purchased by a larger company...still have 2 inventory management systems
and
2 different numbering systems). My problem/question is how do I get the
txtStandardCost field to fill in automatically when the cboItem is filled
in
while still having the cascading combobox effect still work? Field
names/order in the table is ID, Item, Description, StandardCost. Thank
you
in advance for any and all help.



  #3  
Old January 9th, 2008, 09:53 PM posted to microsoft.public.access.forms
SteveP
external usenet poster
 
Posts: 33
Default cascading comboboxes and textbox

I put in the line that you suggested in your reply, but the txtStandardCost
still does not populate. Here is the code I have in the afterupdate for
cboItem:

Private Sub cboItem_AfterUpdate()
Dim sDescription As String

sDescription = "SELECT
[Inventory06].[ID],[Inventory06].[Item],[Inventory06].[Description] " & _
" FROM Inventory06 " & _
" WHERE [Item]='" & Me.cboItem & "'"


Me.cboDescription.RowSource = sDescription
Me.cboDescription.Requery
Me.txtStandardCost = Me.cboItem.Column(3)
End Sub

Do I need to call out the column "StandardCost" in the sDescription line? I
did go back and double check the column names in the table, and field names
on the form to make sure they all match. StandardCost is the 4th column in
the table.

SteveP


"Jeanette Cunningham" wrote:

Hi Steve,
something like this:
in after update for cboItem
me.txtStandardCost = me.cboItem.Column(1)

use whichever column in the cboItem has the standard cost in
me.txtStandardCost = me.cboItem.Column(1)

combo column numbering starts at 0, so the first column is Column(0)

Jeanette Cunningham


"SteveP" wrote in message
...
I have a form with some comboboxes and text fields. The comboboxes I am
working with are called cboItem and cboDescription. The main text field I
am
working with is called txtStandardCost. Right now, I have it as two
cascading comboboxes and a text field that I have to manually enter the
Standard Cost into. As much as I would love to make the cboDescription
into
a text field, I want users to have the option of picking the description
and
having the cboItem fill in with any correlating Item #s (company was
purchased by a larger company...still have 2 inventory management systems
and
2 different numbering systems). My problem/question is how do I get the
txtStandardCost field to fill in automatically when the cboItem is filled
in
while still having the cascading combobox effect still work? Field
names/order in the table is ID, Item, Description, StandardCost. Thank
you
in advance for any and all help.




  #4  
Old January 9th, 2008, 10:18 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default cascading comboboxes and textbox

Try changing this line:
Me.txtStandardCost = Me.cboItem.Column(3)

to
Me.txtStandardCost = Me.cboItem.Column(2)

Jeanette Cunningham


"SteveP" wrote in message
...
I put in the line that you suggested in your reply, but the txtStandardCost
still does not populate. Here is the code I have in the afterupdate for
cboItem:

Private Sub cboItem_AfterUpdate()
Dim sDescription As String

sDescription = "SELECT
[Inventory06].[ID],[Inventory06].[Item],[Inventory06].[Description] " & _
" FROM Inventory06 " & _
" WHERE [Item]='" & Me.cboItem & "'"


Me.cboDescription.RowSource = sDescription
Me.cboDescription.Requery
Me.txtStandardCost = Me.cboItem.Column(3)
End Sub

Do I need to call out the column "StandardCost" in the sDescription line?
I
did go back and double check the column names in the table, and field
names
on the form to make sure they all match. StandardCost is the 4th column
in
the table.

SteveP


"Jeanette Cunningham" wrote:

Hi Steve,
something like this:
in after update for cboItem
me.txtStandardCost = me.cboItem.Column(1)

use whichever column in the cboItem has the standard cost in
me.txtStandardCost = me.cboItem.Column(1)

combo column numbering starts at 0, so the first column is Column(0)

Jeanette Cunningham


"SteveP" wrote in message
...
I have a form with some comboboxes and text fields. The comboboxes I am
working with are called cboItem and cboDescription. The main text
field I
am
working with is called txtStandardCost. Right now, I have it as two
cascading comboboxes and a text field that I have to manually enter the
Standard Cost into. As much as I would love to make the cboDescription
into
a text field, I want users to have the option of picking the
description
and
having the cboItem fill in with any correlating Item #s (company was
purchased by a larger company...still have 2 inventory management
systems
and
2 different numbering systems). My problem/question is how do I get
the
txtStandardCost field to fill in automatically when the cboItem is
filled
in
while still having the cascading combobox effect still work? Field
names/order in the table is ID, Item, Description, StandardCost. Thank
you
in advance for any and all help.






 




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 10:49 AM.


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