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 Combo Subform Tied to Parent
I'm trying to get a cascading combo box in my subform to tie to a combo box
in my parent form. What am I missing??? Private Sub cboSupply() On Error Resume Next cboSupply.RowSource = "Select DISTINCT tblSupply.SUPPLYNAME " & _ "FROM tblSupply " & _ "WHERE tblSupply.SUPPLIERNAME = '" & Parent.[cboSupplier] & "' " & _ "ORDER BY tblSupply.SUPPLYNAME;" End Sub Thank you. |
#2
|
|||
|
|||
Cascading Combo Subform Tied to Parent
What happens when you run that code?
Does Parent.[cboSupplier] return what you think it does? (In other words, you seem to be expecting a name: is that what it returns?) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Tim" wrote in message news I'm trying to get a cascading combo box in my subform to tie to a combo box in my parent form. What am I missing??? Private Sub cboSupply() On Error Resume Next cboSupply.RowSource = "Select DISTINCT tblSupply.SUPPLYNAME " & _ "FROM tblSupply " & _ "WHERE tblSupply.SUPPLIERNAME = '" & Parent.[cboSupplier] & "' " & _ "ORDER BY tblSupply.SUPPLYNAME;" End Sub Thank you. |
#3
|
|||
|
|||
Cascading Combo Subform Tied to Parent
I'm setting up a purchase order w/ the Supply Name, $, and quantity ordered
in the subform and the Supplier Name in the Parent form. I only want to see an individual Suppliers supplies. What happens when I run this, is the supply combo box doesn't limit the supplies to the particular supplier. "Douglas J. Steele" wrote: What happens when you run that code? Does Parent.[cboSupplier] return what you think it does? (In other words, you seem to be expecting a name: is that what it returns?) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Tim" wrote in message news I'm trying to get a cascading combo box in my subform to tie to a combo box in my parent form. What am I missing??? Private Sub cboSupply() On Error Resume Next cboSupply.RowSource = "Select DISTINCT tblSupply.SUPPLYNAME " & _ "FROM tblSupply " & _ "WHERE tblSupply.SUPPLIERNAME = '" & Parent.[cboSupplier] & "' " & _ "ORDER BY tblSupply.SUPPLYNAME;" End Sub Thank you. |
#4
|
|||
|
|||
Cascading Combo Subform Tied to Parent
I don't get the Supply combo box in the subform to limit the supply to the
Supplier. I am trying to build a form for Purchase orders where the Supplier appears in the parent form and the Supply, $, and Quantity ordered appear in the subform. I want the supply combo box to be limited to the supplies the supplier in the parent form supplys. Thank you. "Douglas J. Steele" wrote: What happens when you run that code? Does Parent.[cboSupplier] return what you think it does? (In other words, you seem to be expecting a name: is that what it returns?) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Tim" wrote in message news I'm trying to get a cascading combo box in my subform to tie to a combo box in my parent form. What am I missing??? Private Sub cboSupply() On Error Resume Next cboSupply.RowSource = "Select DISTINCT tblSupply.SUPPLYNAME " & _ "FROM tblSupply " & _ "WHERE tblSupply.SUPPLIERNAME = '" & Parent.[cboSupplier] & "' " & _ "ORDER BY tblSupply.SUPPLYNAME;" End Sub Thank you. |
#5
|
|||
|
|||
Cascading Combo Subform Tied to Parent
And the answer to my question about what Parent.[cboSupplier] returns
is....? Try the following: Private Sub cboSupply() On Error Resume Next Dim strSQL As String strSQL = "Select DISTINCT tblSupply.SUPPLYNAME " & _ "FROM tblSupply " & _ "WHERE tblSupply.SUPPLIERNAME = '" & Parent.[cboSupplier] & "' " & _ "ORDER BY tblSupply.SUPPLYNAME;" Debug.Print strSQL cboSupply.RowSource = strSQL End Sub Go to the Immediate Window (Ctrl-G) and look at what's printed for strSQL. Paste it back here. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Tim" wrote in message ... I don't get the Supply combo box in the subform to limit the supply to the Supplier. I am trying to build a form for Purchase orders where the Supplier appears in the parent form and the Supply, $, and Quantity ordered appear in the subform. I want the supply combo box to be limited to the supplies the supplier in the parent form supplys. Thank you. "Douglas J. Steele" wrote: What happens when you run that code? Does Parent.[cboSupplier] return what you think it does? (In other words, you seem to be expecting a name: is that what it returns?) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Tim" wrote in message news I'm trying to get a cascading combo box in my subform to tie to a combo box in my parent form. What am I missing??? Private Sub cboSupply() On Error Resume Next cboSupply.RowSource = "Select DISTINCT tblSupply.SUPPLYNAME " & _ "FROM tblSupply " & _ "WHERE tblSupply.SUPPLIERNAME = '" & Parent.[cboSupplier] & "' " & _ "ORDER BY tblSupply.SUPPLYNAME;" End Sub Thank you. |
Thread Tools | |
Display Modes | |
|
|