OK, i need some really quick help...
I'm trying to create an sales receipt / invoice form. On the form, I choose a catergory, then product (both combo boxes). I have a command button that I would like to be able to click and add the product to my subform. I've searched here and seen some samples but can get anything to work for me. I know its something simple that I'm missing.
cboCategories
cboProducts
cmdAddProduct
When I add the product, I would like to be able to add both the product and price into the subform
And my subform is Order Details Subform.
I'm trying to create an sales receipt / invoice form. On the form, I choose a catergory, then product (both combo boxes). I have a command button that I would like to be able to click and add the product to my subform. I've searched here and seen some samples but can get anything to work for me. I know its something simple that I'm missing.
cboCategories
cboProducts
Private Sub cboCategories_AfterUpdate()
Me.cboProducts.RowSource = "SELECT Products.productname FROM Products WHERE Products.CategoryID = [cboCategories]" 'Get a list of items in the category.
End Sub
cmdAddProduct
Private Sub cmbAddProduct_Click()
If IsNull(Me.cboCategories) = True Or IsNull(Me.cboProducts) = True Then
MsgBox "Please Select Product(s) from the Category to be Added" 'All fields are required for a line item (record) to be valid.
Else: DoCmd.Save acForm, "Add an Order and Details 2" 'Add the record to the temporary table.
DoCmd.GoToRecord acDataForm, "Add an Order and Details 2", acNewRec
With Me.Order_Details_Subform 'Requery the subform to show the records that have been saved in the table.
.Requery
End With
End If
End Sub
When I add the product, I would like to be able to add both the product and price into the subform
And my subform is Order Details Subform.