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