Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2007, 07:34 AM
Registered User
 
Join Date: Jun 2007
Location: Gouda, , Netherlands.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Listbox Controls

I created a db.
In access I created a form also.
This form contains a listbox wich contains (a part of) al db records.
With a textbox and VB I creates a realtime search in the db.
After every character given in the textbox the listbox contains only the recors who contains the search patron.

Sofar it works realy cool.

However when I click on the listbox I select the row I click on and that's also as I want.
I want that when I leave (or lost focus on) the listbox, this selection will be deselected (and the selection mark will despare.

Someone told me that list.selected(list.listindex)=false must do the job.
Howerver I see the value of list.selected(list.listindex) and that is 0 and stays 0.
The give command must set it to -1. Wich is the value of al the other items of the listbox.

Can someone help my out?

Reply With Quote
  #2 (permalink)  
Old July 17th, 2007, 10:53 AM
Registered User
 
Join Date: Jul 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perhaps you could create an event that will refresh the listbox when it loses focus?

Something like this:

Private Sub "YOUR LISTBOX NAME"_LostFocus()
DoCmd.Requery
End Sub

or

Private Sub "YOUR LISTBOX NAME"_LostFocus()
DoCmd.RepaintObject
End Sub

Have you tried this yet?

Shane
Reply With Quote
  #3 (permalink)  
Old July 17th, 2007, 11:02 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hampshire, United Kingdom.
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi toospeter,

The List.Selected... method only works with Checkbox Lists - From what you are saying, you are using a standard
ListBox yes?

If so, try (Shane was on the right track)
Code:
Private Sub List_LostFocus()
    List.Value = Null
End Sub
Hope this helps.
Regards,
Rob


<center>"Nothing can stop the man with the right mental attitude from achieving his goal;
nothing on earth can help the man with the wrong mental attitude".

Thomas Jefferson</center>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ListBox belete ASP.NET 2.0 Basics 2 October 19th, 2007 04:46 AM
User controls' content: Chapter 2 User Controls AGS BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 10 July 26th, 2007 05:36 AM
multiple Listbox values in another listbox terryv Excel VBA 0 June 27th, 2007 07:01 AM
About listbox csc820203 C# 2 May 1st, 2004 01:32 AM
I'm back :) Listbox var from listbox MichaelTJ .NET Web Services 2 October 21st, 2003 07:06 PM



All times are GMT -4. The time now is 07:16 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.