John Big Booty
AWF VIP
- Local time
- Today, 20:10
- Joined
- Aug 29, 2005
- Messages
- 8,262
OK I think I see our problem here. You appear to have been simply copying and pasting the code into the Events tab of the properties window.
What you need to do is go to the event you wish to put the code in and click in that row. Then from the drop down window select; [Event Procedure]. Once you have done that you will notice a small button with three full stops (ellipsis) will appear, click that button. A new window will appear (the VBA code window) it will look something like;
Paste the code that we have previously discussed between those two lines.
If you manually type your code into the window you will notice that the system will automagically prompted you and provide a list of possible appropriate values.
What you need to do is go to the event you wish to put the code in and click in that row. Then from the drop down window select; [Event Procedure]. Once you have done that you will notice a small button with three full stops (ellipsis) will appear, click that button. A new window will appear (the VBA code window) it will look something like;
Code:
[COLOR="Blue"]Option Compare Database[/COLOR]
[COLOR="Blue"]Private Sub[/COLOR] Expense_Code_BeforeUpdate(Cancel [COLOR="Blue"]As Integer[/COLOR])
[COLOR="Blue"]End Sub[/COLOR]
Code:
[COLOR="Blue"]Option Compare Database[/COLOR]
[COLOR="Blue"]Private Sub[/COLOR] Expense_Code_BeforeUpdate(Cancel [COLOR="Blue"]As Integer[/COLOR])
[COLOR="Green"]'Insert your code here[/COLOR]
[COLOR="Blue"]End Sub[/COLOR]