SOS
Registered Lunatic
- Local time
- Today, 14:08
- Joined
- Aug 27, 2008
- Messages
- 3,514
Okay, the problem appears to be that you manually typed in this part:
Private Sub Form_BeforeUpdate()
instead of letting Access put it in by selecting the dropdown and then clicking on the ellipsis to open to that event. What I did was to go to the VBA Window, select the whole SUB and then Cut it out and pasted to NOTEPAD. Then I go up to the dropdowns that are in the VBA Window, select FORM from the left one and then select BEFORE UPDATE from the one on the right. THEN paste the code I pasted into NOTEPAD in between the PRIVATE SUB ... and the END SUB parts, not including those for the other.
Also, you need to have is like this (instead of on one line for the IF):
Private Sub Form_BeforeUpdate()
instead of letting Access put it in by selecting the dropdown and then clicking on the ellipsis to open to that event. What I did was to go to the VBA Window, select the whole SUB and then Cut it out and pasted to NOTEPAD. Then I go up to the dropdowns that are in the VBA Window, select FORM from the left one and then select BEFORE UPDATE from the one on the right. THEN paste the code I pasted into NOTEPAD in between the PRIVATE SUB ... and the END SUB parts, not including those for the other.
Also, you need to have is like this (instead of on one line for the IF):
Code:
If Me.Xource = 1 And Len(Me.MMUID & "") = 0 Then
Cancel = True
MsgBox "You need to fill in the Student ID", vbExclamation, "Entry Error"
End If