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  dBforums > PC based Database Applications > Microsoft Access > ListBox.Value not updating

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-08-12, 08:52
Neehy Neehy is offline
Registered User
 
Join Date: Feb 2012
Posts: 2
ListBox.Value not updating

Hello everyone,

I faced a problem where after repopulating my list with data .Value of my list box is not updating if it disappears from the list.

For example I have a list box:
"something1"
"something2"
"something3"

I select "something2" and press my refresh button. If "something2" is no longer exists nothing will be selected but .Value will be still "something2".

How can I fix this?

Thank you.
Reply With Quote
  #2 (permalink)  
Old 02-08-12, 08:59
Neehy Neehy is offline
Registered User
 
Join Date: Feb 2012
Posts: 2
I also have one more button and basically I need it to be enabled only when something is selected on the list.
Reply With Quote
  #3 (permalink)  
Old 02-08-12, 16:01
dave0810471 dave0810471 is offline
Registered User
 
Join Date: Jan 2012
Posts: 87
Is the list box a bound or unbound control? If its unbound then you can set the value to null when running the code on your refresh button.
As for your other button I would run some code in the OnChange event of your listbox, something like...

Code:
If me.listboxname.value = "thevalueyourlookingfor" Then
me.nameofcommandbutton.enabled = True
Else
me.nameofcommandbutton.enabled = False
End if
Hope this helps,
Dave
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 On
Pingbacks are On
Refbacks are On