Same dbase, I have to issue equipment where the stock numbers (NSN) are required on the report. The sizeable items have different NSN's, i.e.:
Helmet
Small 7526
Medium 7527
Large 7528
I currently have the form set up with the bound field for helmet with a quantity requirement; next to it is a combo box that is linked to a query showing all items with sizes -this combo box lists each item requiring a size, i.e. Helmet, Small or Helmet, Large; next to it is a label that autofills with the correct NSN once a selection is made. Also in this code is a afterupdate for cbohelmet to show the size (large, Medium, etc) once a selection is made. Below is the code.
===================================
Private Sub cbohelmet_AfterUpdate()
Me.txthelmet.Value=dlookup "[lastfour]", "qrysize",
"[equipment]='" & Me.cbohelmet.Value & "'"
Me.cbohelmet.Value=dlookup("[size]", "qrysize", "[equipment]='" & Me.cbohelmet.Value & "'"
End Sub
===================================
What I want to do is have the combo box ONLY pull the information from the query that it needs, i.e. when I select the combo box for Helmet I don't want to see the other items such as chemsuits, sweaters, wet weather items, etc. In my thinking I need to somehow related the Afterupdate code to the label for the item that I am working with, i.e. the code looks at the label for Helmet and realizes that it should only show the sizes for the item. I hope this makes sense. I would love to send the file to anyone not understanding my direction here.
Thanks.
Tony
Helmet
Small 7526
Medium 7527
Large 7528
I currently have the form set up with the bound field for helmet with a quantity requirement; next to it is a combo box that is linked to a query showing all items with sizes -this combo box lists each item requiring a size, i.e. Helmet, Small or Helmet, Large; next to it is a label that autofills with the correct NSN once a selection is made. Also in this code is a afterupdate for cbohelmet to show the size (large, Medium, etc) once a selection is made. Below is the code.
===================================
Private Sub cbohelmet_AfterUpdate()
Me.txthelmet.Value=dlookup "[lastfour]", "qrysize",
"[equipment]='" & Me.cbohelmet.Value & "'"
Me.cbohelmet.Value=dlookup("[size]", "qrysize", "[equipment]='" & Me.cbohelmet.Value & "'"
End Sub
===================================
What I want to do is have the combo box ONLY pull the information from the query that it needs, i.e. when I select the combo box for Helmet I don't want to see the other items such as chemsuits, sweaters, wet weather items, etc. In my thinking I need to somehow related the Afterupdate code to the label for the item that I am working with, i.e. the code looks at the label for Helmet and realizes that it should only show the sizes for the item. I hope this makes sense. I would love to send the file to anyone not understanding my direction here.
Thanks.
Tony