By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,586 Members | 992 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,586 IT Pros & Developers. It's quick & easy.

Syncronize unbound list box with rest of the form

P: 40
Hello,
I am quite new to this, the forum and Access as well.

I have made a form with a long list box on the side as I have a long list of records and combo box was unhandy for the purpose...

Got to the point where when I select a record in the list box it is displayed in the form, and it requerys on gotFocus (I could not get it to update as changes are made, but this fine as well)

So my problem:
selection in list box is not synchronized with the form. If I change a record not by selecting in the list (buttons at the bottom or scroll wheel) Selection in list box does not change, so it gets a bit confusing. One record is selected in list box but different is showed in the form

So how can I keep it up to date, or alternatively how to stop other ways of change record, so user is forced to select form list?

Hope it makes sense.. ;)

Thank you in advance

Edit:
I use Access 2000 on Win2000
Sep 13 '07 #1
Share this Question
Share on Google+
7 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Try putting this in the Forms On Current Event.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.  
  3.     Me.Refresh
  4.  
  5. End Sub
  6.  
Sep 14 '07 #2

P: 40
Unfortunately that did not work... appreciate it though

Maybe it is possible to remove selection in the list box once I have made some changes in Form? I mean the black border around my last selection in list box.
Sep 14 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Unfortunately that did not work... appreciate it though

Maybe it is possible to remove selection in the list box once I have made some changes in Form? I mean the black border around my last selection in list box.
Are your records on the same form as the listbox or a subform?
Sep 14 '07 #4

P: 40
They are on the same form,
I have a subform there as well but that links to different table and works fine...
Sep 17 '07 #5

MMcCarthy
Expert Mod 10K+
P: 14,534
They are on the same form,
I have a subform there as well but that links to different table and works fine...
I'm not sure whats happening. Me.Refresh should clear all selections from a listbox. I suppose you could try Me.Requery.

The Form Current event should trigger every time you change the change the current record on a form.
Sep 17 '07 #6

P: 40
Nope... non of them work. Me.Refresh seems to have no effect.
and Me.Requery just requerys all the info in forms and subforms taking a long time and at the end always goes back to the first record on the form. Nevertheless thank you for this as it allowd me to solve another less important issue. How to update list after changes have been made in form by me.full_list.requery however no matter what I do (especially when I go to different record) the last item I selected in listbox is still highlited...

PS
I really appreciate u taking ur time to help me out.. :)
Sep 17 '07 #7

P: 40
Good news... I found a way to sort of solve the problem.
in form_current I just added:
Me.full_list.Value = Null
this way once there are changes made it just deselects whatever is selected in listbox.
Sep 17 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.