I'm trying to get some code to run on a form load.
However, I get the message:
Compile error: Sub or Function not defined
It happens on the line: Public Sub Form_Load()
Option Compare Database
Public Sub Form_Load()
Me.txtSearch.BackColor = vbYellow
Task = "SELECT * FROM tblTracks WHERE (ID)is null"
Me.RecordSource = Task
Me.txtSearch.SetFocus
End Sub
I've tried Private/Public and having neither - just Sub - but they all give the same error.
I've tried adding Option Explicit and retyping the code from scratch - as suggested - now I have a Compile Error:
Could anyone help please?
Thanks, Mark