[AccessD] Listbox Issue - Selected Property or ListIndex persisting after requery

Bill Benson vbacreations at gmail.com
Wed Mar 12 16:28:37 CDT 2014


Thanks Stuart.

And NOW I know... the rest of the story.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Wednesday, March 12, 2014 5:26 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Listbox Issue - Selected Property or ListIndex
persisting after requery


Clearing the rowsource does not clear the value of the bound field behind
the combobox, it 
only clears what can be displayed.  Set the value of the lisbox to Null at
the same time as 
you requery.


On 12 Mar 2014 at 16:44, Bill Benson wrote:

> I have written listbox that has Table/Query RowsourceType property.
> 
> I am trying to clear the selection in it by requery. It does not seem to
be
> working.
> 
> In particular, if the user has selected B out of 
> 
> A
> B
> C
> 
> 
> Then when I change Rowsource = "" and requery, the listbox contents
vanish,
> but when I make the rowsource equal to what it was, the selected item is
> still selected.
> 
> My concern about this is, what happens if B no longer exists, or the order
> of items changes, since I do not have a primary key type data field in the
> listbox.
> 
> I could switch to AddItem but that might be slower.
> 
> All I want to do is have nothing selected after a requery.
> 
> Pulling hair out.
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list