I think this may be my final 'issue' with this project....!
I need to add products to a quotation/point of sale form. My products are listed in a listbox on my main form (frmMain) - when I click Add To Basket I need the product to be added to the subform of the Quote form (frmQuotation).
Additionally, I need for the code to recognise whether it is the FIRST product or not.
What I have at the moment is an Employee No. field on the quotation form that if it is 'notNull' then a record already exists in the subform and therefore the subform gets the focus directly, enabling products to be sent over from the main form...
This is what I have attached to my Add To Basket click event...
The 'code' is a mess because I've been pulling it around for hours. Virtually the same code (based on gstrwheretyre public variable) works well, but i can't seem to get it to send record details to the subform.
I know from experience here that you can help, it's just whether I've described it concisely enough?!
Thanks for your help,
stonward
I need to add products to a quotation/point of sale form. My products are listed in a listbox on my main form (frmMain) - when I click Add To Basket I need the product to be added to the subform of the Quote form (frmQuotation).
Additionally, I need for the code to recognise whether it is the FIRST product or not.
What I have at the moment is an Employee No. field on the quotation form that if it is 'notNull' then a record already exists in the subform and therefore the subform gets the focus directly, enabling products to be sent over from the main form...
This is what I have attached to my Add To Basket click event...
Code:
Dim strProduct As String, varSelected As Variant
Dim empVal
If CurrentProject.AllForms(“frm_quotation”).IsLoaded = False Then
InputBox "Enter your I.D", "GYRuS: Quotation by Employee..:"
If empVal = "" Then Exit Sub
Else: Form_frm_quotation.StaffNo = empVal
DoCmd.OpenForm "frm_quotation", acNormal, , , acFormAdd
If Me.List55.ItemsSelected.Count = 0 Then MsgBox "Select a Product!", vbCritical + vbOKOnly, "GYRuS: Select a Product"
For Each varSelected In Me!List55.ItemsSelected
strProduct = strProduct & Me!List55.Column(0, varSelected)
Next varSelected
gstrwheretyre = "[productid] in (" & strSelected & ")"
DoCmd.OpenForm FormName:="quotesub", wherecondition:=gstrwheretyre
End If
I know from experience here that you can help, it's just whether I've described it concisely enough?!
Thanks for your help,
stonward
Comment