AllExperts > Experts 
Search      

Internet for Beginners

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Internet for Beginners Answers
Question Library

Ask a question about Internet for Beginners
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Scottgem
Expertise
I can answer a wide variety of questions pertaining to making the most of cyberspace.

Experience
I have been using cyberspace and the Internet for over 15 years.

 
   

You are here:  Experts > Computing/Technology > Understanding Computers > Internet for Beginners > Listbox Double Click Event Not Returning Value

Topic: Internet for Beginners



Expert: Scottgem
Date: 6/20/2008
Subject: Listbox Double Click Event Not Returning Value

Question
QUESTION: Scott:

Your previous help and advice with listboxes was great, it worked fine. Essentially you recommended that on the Update Event or Click event of my listbox I change the keycontrol of the main form's listbox so that it would requery the otherform successfuly. That all worked out fine and I thank you! However, I have run into a problem. Even though I tested the listbox to see if it would successfuly update- which it did- the listbox on Otherform does NOT return a value for the ItemID in question. When I click on the listbox it returns a value of 'Null'- which is strange because the listbox is populated by many values. The bound column is the same as the Mainform. I don't know why the listbox is returning null values. The MainForm listbox allows me to individually highlight and select values. The OtherForm listbox does NOT highlight or select any values and upon clicking it it simply returns a blank screen because the value is null. The formula i am using is as follows:

Private Sub lst_OtherFormList(Cancel As Integer)
   Dim strItemId As String
   strItemId = Me.lst_OtherFormList
   Forms!frm_MainForm!lst_MainFormList = strItemId
   Me.Requery
End Sub

When I run that the form returns a BLANK value. (null) When I set strItemId = 64 or any other number it returns the appropriate value. There must be a way to fix my listbox.

Thank you in advance!

Best Regards,

P.

ANSWER: Is the bound column a text datatype? Is the Multi-Select property set to Yes? If you step thru the code what does strItemID populate with.

Hope this helps,
Scott<>
Microsoft Access MVP 2007
Author: MS Office Access 2007 VBA

---------- FOLLOW-UP ----------

QUESTION: All of fields and tables are text datatypes. The 'Multi-Select' property is set to 'None'. 'strItemID' populates with 'Null'. The OtherFormListBox doesn't even provide values. It's as if the values are unable to be touched or read. I think the listbox is locked in some way or glitched.

Answer
Well first I have to mention that having all fields as text types is not a good idea. Primary key should be autonumbers.

Now this is puzzling that strItemID would be a Null is something is selected in the list. But without looking at it I can't tell why.

If you want you can zip a copy of your DB and attach to a post at askmehelpdesk.com and I'll look at it.

Hope this helps,
Scott<>
Microsoft Access MVP 2007
Author: MS Office Access 2007 VBA


Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.