Create combo box that clears select fields in Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I have a form that our employees use when customers are on the phone to
help them price out different options on a package. HOwever, once an
employee has made several selections, they might not be the ones they
ultimately want to keep. So I would like to create a command button that
when an employee pushes it will clear all the data in those selected fields.
Is this possible? And if so, how can I do it?
 
Hi, I have a form that our employees use when customers are on the phone to
help them price out different options on a package. HOwever, once an
employee has made several selections, they might not be the ones they
ultimately want to keep. So I would like to create a command button that
when an employee pushes it will clear all the data in those selected fields.
Is this possible? And if so, how can I do it?

Sure. Create the command button on the form (without using the
wizard). View its Properties, and click the ... icon by the Click
property on the Events tab. Invoke the Code Builder and put something
like

Private Sub ClearOptions_Click()
Dim iAns As Integer
iAns = MsgBox("Clear all selected options?", vbYesNo)
If iAns = vbYes Then
Me!txtThisOption = Null
Me!cboThatOption = Null
<whatever other changes you want to make>
End If
End Sub

John W. Vinson[MVP]
 
Back
Top