I'm having a general problem with a msgbox - not a big one - just a procedural one i think.
On a form (fmProducts) there are two combo boxes: cboCategory and cboFeature. When the user selects a Category code (cboCategory), this selection filters the list result in cboFeature. However when there are no Features associated with a Category, I want to display a msgbox with the option for the user to add New Features.
At the moment I have the msgbox activating in the GotFocus event of the Features combo box.
If me.cboFeature.listcount then
' do this, listcount is true
...
Else
' do this, listcount is false
Dim response
response = Msgbox("Do you want to add New Features?, vbYesNo)
If response = vbYes then
Docmd.OpenForm "fmAddFeatures"
Else ' no
' do nothing
End If
End if
When the user clicks "Yes" form fmAddFeatures fires up, and the user adds the new features associated with the Category code lasted used on the previous form. However when the user closes out of fmAddFeatures, the msgbox from fmProducts is still active. How do I prevent this? After all the user has already made the selection from Yes/No - they do not need to do it again.
thanks L.
On a form (fmProducts) there are two combo boxes: cboCategory and cboFeature. When the user selects a Category code (cboCategory), this selection filters the list result in cboFeature. However when there are no Features associated with a Category, I want to display a msgbox with the option for the user to add New Features.
At the moment I have the msgbox activating in the GotFocus event of the Features combo box.
If me.cboFeature.listcount then
' do this, listcount is true
...
Else
' do this, listcount is false
Dim response
response = Msgbox("Do you want to add New Features?, vbYesNo)
If response = vbYes then
Docmd.OpenForm "fmAddFeatures"
Else ' no
' do nothing
End If
End if
When the user clicks "Yes" form fmAddFeatures fires up, and the user adds the new features associated with the Category code lasted used on the previous form. However when the user closes out of fmAddFeatures, the msgbox from fmProducts is still active. How do I prevent this? After all the user has already made the selection from Yes/No - they do not need to do it again.
thanks L.