Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Checking and SetFocus

Status
Not open for further replies.

charlie12345

Technical User
Mar 4, 2001
28
US
When a user makes a choice from ListBox1, I populate ListBox2 (unbounded) based on the value of ListBox1, and set the focus to the first line "-----", forcing the User to make a choice.

On ListBox2 I use the LostFocus() event to check whether the user made a choice other than "-----". If the value is stil "-----" I display a message and set the focus back to ListBox2.

Problem - the focus doesn't go to ListBox2 the second time, but moves to the next control.

I tried moving the Error Checking to the Form_BeforeUpdate event, and it works on the first pass, but if the User attempts to Save the record a second time without making a choice, Access goes ahead and moves to the next record.

Suggestions?

Thanks,
Charlie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top