Retaining User Selection on an Access List Box

wwce

New Member
Joined
Feb 4, 2013
Messages
19
I have a form with a list box in access of Supervisors called “Supervisor List”.</SPAN>

They highlight/select their name from the list box, then proceed to enter their data.</SPAN>

Once done, they hit the submit button, which then enters their data into a table and opens a new blank record.</SPAN>

QUESTION: Is there a way to have the “Supervisor List” list box retain the last selected value, that way the user won’t have to keep selecting his/her name every time they enter new data on the form?</SPAN>

I have a code in the event procedure when they click the submit button, but do not know how to code it.


Dim MySelect As Variant
MySelect = Me.[Supervisor List]
DoCmd.GoToRecord , , acNewRec
[Supervisor List].Selected(MySelect) = True
</SPAN>
But this code doesn't work. Any help is appreciated, thank you!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
try changing the last line of code to read
Code:
me.[supervisor List]=MySelect
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top