You’ve created a data entry form that uses a combo box, as shown in Figure A. However, when the user clicks the next record button, the previous record’s combo box selection is still visible.
To clear the entry for entering the next record, follow these steps:
- Open the form in Design view.
- Click the Form properties button at the top left of the form.
- In the Event tab, click the On Current property box and select Event Procedure (Figure B).
- Click the Build button.
- Enter the following code at the prompt:
Private Sub Form_Current()
On Error Go to ErrorHandler
Me![cboname of box]= Null
MsgBox "Error No: " & Err.Number &": Description: " & Err.Description
Resume ErrorHandlerExitEnd Sub
- Press [Alt]+Q
Now when the user moves to the next record, the previous selection will not appear.
Miss an Access tip?
Check out the Microsoft Access archive and catch up on other Access tips.
Help users increase productivity by automatically signing up for TechRepublic’s free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.
Subscribe to the Developer Insider Newsletter
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays