PC Review


Reply
Thread Tools Rate Thread

clearing the contents displayed in controls on a form

 
 
Karen
Guest
Posts: n/a
 
      28th Mar 2007
I have a form with a query as the record source. The form has a
control (entercode) in the form header that is used as a seach field.
The user enters a code in the control and clicks a button to find that
code in the query.

I'd like to have all of the controls in the details section of the
form go blank when the user clicks in the entercode control again. I
don't want to delete anything from the tables, just make the controls
blank like they are when the form opens.

anyone have any ideas for me?

Karen S

 
Reply With Quote
 
 
 
 
strive4peace
Guest
Posts: n/a
 
      28th Mar 2007
Hi Karen,

'~~~~~~~~~~~
'find the first value that matches

'-------------------- CHOOSE ONE
'if search control is numeric
Me.RecordsetClone.FindFirst "Field = " & me.SearchControlname

'if search control is text
Me.RecordsetClone.FindFirst "Field = '" & me.SearchControlname & "'"
'--------------------

'if a matching record was found, then move to it
'otherwise, go to a new record
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
else
docmd.runcommand acCmdRecordsGoToNew
'set control value if desired
me.controlname = me.SearchControlname
End If
'~~~~~~~~~~~


Warm Regards,
Crystal
*
(: have an awesome day
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Karen wrote:
> I have a form with a query as the record source. The form has a
> control (entercode) in the form header that is used as a seach field.
> The user enters a code in the control and clicks a button to find that
> code in the query.
>
> I'd like to have all of the controls in the details section of the
> form go blank when the user clicks in the entercode control again. I
> don't want to delete anything from the tables, just make the controls
> blank like they are when the form opens.
>
> anyone have any ideas for me?
>
> Karen S
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
clearing the values of all the controls in a form chanu Microsoft Access Form Coding 1 13th Dec 2009 05:54 PM
Clearing contents of controls (combo box and sub form) Rob W Microsoft Access 1 18th Feb 2008 05:55 AM
Clearing contents of a form =?Utf-8?B?a21obmhzdWs=?= Microsoft Access Forms 6 22nd Jun 2005 02:50 PM
How can I allow controls to grow/shrink on a displayed form? =?Utf-8?B?SEpE?= Microsoft Access Forms 8 1st May 2004 03:04 PM
Clearing all controls on a form T. Microsoft Access Forms 4 15th Mar 2004 09:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:03 PM.