L
LOP
I have a subform that has a combo box containing a result set of a query
based on a criteria from a textbox in the main form. The goal is if a user
clicks on a value from the combo box it should update values on two other
textboxes in the main form. Here's my code in the AfterUpdate event of the
subform:
Dim LSQL As String
LSQL = "SELECT [Master_SoftwareProduct].[ID],
[Master_SoftwareProduct].[Standard Product Name], "
LSQL = LSQL & " [Master_SoftwareProduct].[Manufacturer] FROM
Master_SoftwareProduct WHERE "
LSQL = LSQL & "[Product]= " & txtbxProduct.Value
cbxStandardProductName.RowSource = LSQL
Me!frmMainProduct!txtbxStdProductName.Value =
Me!cbxStandardProductName.Column(1)
Me!frmMainProduct!txtbxStdMfgName.Value =
Me!cbxStandardProductName.Column(2)
I get an error when saving the column values into the textboxes in the main
form saying it could not recognize frmMainProduct (main form). Secondly, how
do I reset the combo box so that when I use the main form's navigation bar it
will clear what was selected previously? Any help is appreciated.
based on a criteria from a textbox in the main form. The goal is if a user
clicks on a value from the combo box it should update values on two other
textboxes in the main form. Here's my code in the AfterUpdate event of the
subform:
Dim LSQL As String
LSQL = "SELECT [Master_SoftwareProduct].[ID],
[Master_SoftwareProduct].[Standard Product Name], "
LSQL = LSQL & " [Master_SoftwareProduct].[Manufacturer] FROM
Master_SoftwareProduct WHERE "
LSQL = LSQL & "[Product]= " & txtbxProduct.Value
cbxStandardProductName.RowSource = LSQL
Me!frmMainProduct!txtbxStdProductName.Value =
Me!cbxStandardProductName.Column(1)
Me!frmMainProduct!txtbxStdMfgName.Value =
Me!cbxStandardProductName.Column(2)
I get an error when saving the column values into the textboxes in the main
form saying it could not recognize frmMainProduct (main form). Secondly, how
do I reset the combo box so that when I use the main form's navigation bar it
will clear what was selected previously? Any help is appreciated.