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  

Clear Query in Drop-Down Box



 
 
Thread Tools Display Modes
  #1  
Old December 22nd, 2006, 03:40 PM posted to microsoft.public.access.forms
rattler0812
external usenet poster
 
Posts: 19
Default Clear Query in Drop-Down Box

I have a form where the drop down box is attached to a query inside the SQL
string to pull a name of an approved authorizer, and another drop-down box
(similar design) for approved requestors of priority work requests. When you
click on the box, you are asked for part of a name. It will then search and
pull the names within that search so that you are not searching through
hundreds of names of requestors or authorizers. It works great until you go
to the next records (or new records for that matter. It will still hold the
information from the last time you entered it and will not allow a clearing
of the information. I have tried a macro, but that just makes the form act
really wierd.

Any ideas or advice on how I can work around (or with) this?

Rattler0812
  #2  
Old December 22nd, 2006, 07:40 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Clear Query in Drop-Down Box

Since the value in the combo box (drop down) is not staying in sync with the
record on your form, that indicates it is an unbound control. This is normal
behaviour for unbound controls. Because the combo is being used as a search
tool, it is correct for it to be an unbound control.

Although it is really of no consequence what the value of the combo is, it
will not affect anything else unless something in the code in your form uses
that value and expects it to be related to the record on your form. If you
have a large number of rows returned by your combo, keeping it in sync with
the current record will be a performance hit, but the technique to do this
would be to use the current event of the form:

Me.MyCombo = Me.TheBoundControl

Where TheBoundControl would be the control on your form that hold the
requestor or authorizer.

Since it is only a search control, I would just clear it out with:
Me.MyCombo = Null

Also in the Current event.


"rattler0812" wrote:

I have a form where the drop down box is attached to a query inside the SQL
string to pull a name of an approved authorizer, and another drop-down box
(similar design) for approved requestors of priority work requests. When you
click on the box, you are asked for part of a name. It will then search and
pull the names within that search so that you are not searching through
hundreds of names of requestors or authorizers. It works great until you go
to the next records (or new records for that matter. It will still hold the
information from the last time you entered it and will not allow a clearing
of the information. I have tried a macro, but that just makes the form act
really wierd.

Any ideas or advice on how I can work around (or with) this?

Rattler0812

 




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


All times are GMT +1. The time now is 12:05 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.