13.07.2015 Views

Clear an Access Combo Box for Entering the Next Record

Clear an Access Combo Box for Entering the Next Record

Clear an Access Combo Box for Entering the Next Record

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Clear</strong> <strong>an</strong> <strong>Access</strong> combo box <strong>for</strong> entering <strong>the</strong> next record | Microsoft Office | TechRepublic...http://blogs.techrepublic.com.com/msoffice/?p=1304&tag=nl.e056Page 1 of 45/13/2009<strong>Clear</strong> <strong>an</strong> <strong>Access</strong> combo box <strong>for</strong> entering<strong>the</strong> next recordDate: May 12th, 2009Author: Mary Ann RichardsonCategory: <strong>Access</strong>, TipsTags: Microsoft <strong>Access</strong>, <strong>Clear</strong>, Microsoft Office, Databases, Office Suites, Software, EnterpriseSoftware, Data M<strong>an</strong>agement, Mary Ann Richardson


<strong>Clear</strong> <strong>an</strong> <strong>Access</strong> combo box <strong>for</strong> entering <strong>the</strong> next record | Microsoft Office | TechRepublic...http://blogs.techrepublic.com.com/msoffice/?p=1304&tag=nl.e056Page 2 of 45/13/2009You c<strong>an</strong> have <strong>Access</strong> clear <strong>the</strong> selection from a combo box in a data entry <strong>for</strong>m so that <strong>the</strong>user starts fresh with each new record. See how to make this user-friendly tweak.You’ve created a data entry <strong>for</strong>m that uses a combo box, as shown in Figure A. However, when<strong>the</strong> user clicks <strong>the</strong> next record button, <strong>the</strong> previous record’s combo box selection is still visible.Figure ATo clear <strong>the</strong> entry <strong>for</strong> entering <strong>the</strong> next record, follow <strong>the</strong>se steps:Figure BOpen <strong>the</strong> <strong>for</strong>m in Design view.Click <strong>the</strong> Form properties button at <strong>the</strong> top left of <strong>the</strong> <strong>for</strong>m.In <strong>the</strong> Event tab, click <strong>the</strong> On Current property box <strong>an</strong>d select Event Procedure (FigureB).


<strong>Clear</strong> <strong>an</strong> <strong>Access</strong> combo box <strong>for</strong> entering <strong>the</strong> next record | Microsoft Office | TechRepublic...http://blogs.techrepublic.com.com/msoffice/?p=1304&tag=nl.e056Page 3 of 45/13/2009Click <strong>the</strong> Build button.Enter <strong>the</strong> following code at <strong>the</strong> prompt:Private Sub Form_Current()On Error Go to ErrorH<strong>an</strong>dlerMe![cboname of box]= NullErrorH<strong>an</strong>dlerExitExit SubErrorH<strong>an</strong>dler:Msg<strong>Box</strong> "Error No: " & Err.Number &": Description: " & Err.DescriptionResume ErrorH<strong>an</strong>dlerExitEnd SubPress [Alt]+QNow when <strong>the</strong> user moves to <strong>the</strong> next record, <strong>the</strong> previous selection will not appear.Miss <strong>an</strong> <strong>Access</strong> tip?Check out <strong>the</strong> Microsoft <strong>Access</strong> archive <strong>an</strong>d catch up on o<strong>the</strong>r <strong>Access</strong> tips.Help users increase productivity by automatically signing up <strong>for</strong> TechRepublic’s free MicrosoftOffice Suite newsletter, featuring Word, Excel, <strong>an</strong>d <strong>Access</strong> tips, delivered each Wednesday.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!