I am an access user that normally just uses the functionality of the software without any custom scripting or VBA usage. I was asked by a friend to create a simple database that tracks employee concerns which I did. However, there are three combo boxes that have names and other data supplied from separate tables. When I finish each record and move to the next one, the names used in the previous record automatically populate in the new records combo boxes.
I am looking to CLEAR THE COMBO BOX for the new record. I came across this bit of code along with the following directions which i followed:
______
Private Sub Form_Current()
On Error GoTo ErrorHandler
Me![cboname of box]= Null
ErrorHandlerExit
Exit Sub
ErrorHandler:
MsgBox "Error No: " & Err.Number &": Description: " & Err.Description
Resume ErrorHandlerExit
End Sub
_____________
To clear the entry for entering the next record, follow these steps:
1.Open the form in Design view.
2.Click the Form properties button at the top left of the form.
3.In the Event tab, click the On Current property box and select Event Procedure
4.Click the Build button.
5.Enter the following code at the prompt (SEE CODE ABOVE)
6.Press [Alt]+Q
_________________
i followed this exactly and now I am getting error.....I do not know VBA and am learning as I go.
The FOURTH line of code has "ErrorHandlerExit"
When I run the code I get the error: "Compile Error: Sub or Function Not Defined"
ALSO, am I supposed to leave the Me![cboname of box]= Null expression as is or do I add my own data regarding my database and and tables?
I have searched all over for the solution and have not found any relevant posts. Hoping the experts here can find time to hopefully fix this seemingly easy issue.
Thank you in advance, if any assisting experts are in the Philadelphia area I will buy the beer!!! :banghead:
I am looking to CLEAR THE COMBO BOX for the new record. I came across this bit of code along with the following directions which i followed:
______
Private Sub Form_Current()
On Error GoTo ErrorHandler
Me![cboname of box]= Null
ErrorHandlerExit
Exit Sub
ErrorHandler:
MsgBox "Error No: " & Err.Number &": Description: " & Err.Description
Resume ErrorHandlerExit
End Sub
_____________
To clear the entry for entering the next record, follow these steps:
1.Open the form in Design view.
2.Click the Form properties button at the top left of the form.
3.In the Event tab, click the On Current property box and select Event Procedure
4.Click the Build button.
5.Enter the following code at the prompt (SEE CODE ABOVE)
6.Press [Alt]+Q
_________________
i followed this exactly and now I am getting error.....I do not know VBA and am learning as I go.
The FOURTH line of code has "ErrorHandlerExit"
When I run the code I get the error: "Compile Error: Sub or Function Not Defined"
ALSO, am I supposed to leave the Me![cboname of box]= Null expression as is or do I add my own data regarding my database and and tables?
I have searched all over for the solution and have not found any relevant posts. Hoping the experts here can find time to hopefully fix this seemingly easy issue.
Thank you in advance, if any assisting experts are in the Philadelphia area I will buy the beer!!! :banghead: