Real quick help

escoyne

Registered User.
Local time
Today, 17:09
Joined
Jul 24, 2009
Messages
32
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
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.
 
Try looking at the Northwinds sample DB that comes with Access. You should find the Order form will help you
 
Try looking at the Northwinds sample DB that comes with Access. You should find the Order form will help you


Yeah, I looked at it. Not quiet what I was looking for. In the sample DB, there is only 77 products. I have over 770 products! divided into 5 categories.
 
Yeah, I looked at it. Not quiet what I was looking for. In the sample DB, there is only 77 products. I have over 770 products! divided into 5 categories.
The principal is the same regardless of how many products. Use cascading combos to select the categories then the product.
 
Hmmm? The Northwind DB that I have doesnt have casading combos..
 
Gosh you really don't want to help yourself. Search this forum for cascading combos.

FIRST OFF, I do want to help my!!.. Go back to my orginal post and reread what I'm asking help with.

I've got the cascading combo boxes already. I'm trying to figure out how to add my products into my subform. The VBA code that i'm using isn't work.

boblarson:91275 said:
Well, I don't know if this will help but here's a sample of a cascading combo.

thanks anyways
 
The VBA code that i'm using isn't work.
How about creating an Append Query and then calling that when you want to add one. I did that in a Point of Sale system I created. I had the combos for the category and product in the subform header (using continuous form) and then called the append query and requeried the subform.
 

Users who are viewing this thread

Back
Top Bottom