A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Create combo box that clears select fields in Form



 
 
Thread Tools Display Modes
  #1  
Old January 16th, 2005, 11:41 PM
StaceyJ
external usenet poster
 
Posts: n/a
Default Create combo box that clears select fields in Form

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?
  #2  
Old January 17th, 2005, 01:55 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Sun, 16 Jan 2005 15:41:03 -0800, "StaceyJ"
wrote:

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]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate fields in Form Header based on header fields in startup f Pat Dools Using Forms 0 January 7th, 2005 03:19 PM
Need to clear controls of Filter form Jan Il Using Forms 2 November 28th, 2004 02:04 PM
Cursor Positioning Colin Hammond General Discussion 3 November 2nd, 2004 08:42 PM
Combo Box Problem Mr. T New Users 15 July 15th, 2004 09:47 PM
Data Dependencies between Combo Boxes Tom Using Forms 7 June 6th, 2004 05:25 PM


All times are GMT +1. The time now is 08:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.