Hi I'm trying to search for a surname on a form
from a table called students. I want the result to goto the record on the form.
The tablename is Students and the field I want to search is called Surname
I wrote this code:
Dim Search As String
Search = InputBox("Please enter the Surname", "OrderSearch")
DoCmd.OpenForm "Pastoral record form", acNormal
DoCmd.FindRecord "[Surname] =" & Search, acEntire, False, acSearchAll, , acCurrent, True
But I get some weird error about macros... does anybody know what I have done wrong?
thanks
from a table called students. I want the result to goto the record on the form.
The tablename is Students and the field I want to search is called Surname
I wrote this code:
Dim Search As String
Search = InputBox("Please enter the Surname", "OrderSearch")
DoCmd.OpenForm "Pastoral record form", acNormal
DoCmd.FindRecord "[Surname] =" & Search, acEntire, False, acSearchAll, , acCurrent, True
But I get some weird error about macros... does anybody know what I have done wrong?
thanks