vba - Seach function in Access syntax error: missing a comma in query expression -
i have problem while i'm working on search function @ windows access allowed me search after 3 things. in case, it's first name, last name , cpr. cpr means it's serial of unique numbers each users on database.
it started macro changed vba code because want have option search after 3.
when it's in macro, can find 2 things because limit write characters in macro 255, reason changed vba code characters limit should unlimited.
ah, forgot, code's in danish, think basic functions of code pretty same everywhere so...
here problem:
on error goto søgefterfornavn_err if (isnull(forms!navigationsformular!navigationunderformular!searchfor)) beep exit function else docmd.setfilter "søgnings forespørgelse", "[fornavn] ""*"" & [forms]![navigationsformular]![navigationunderformular]![searchfor] & ""*"" or [cpr] ""*"" & [forms]![navigationsformular]![navigationunderformular]![searchfor] & ""*"" or [efternavn] ""*"" & [formularer]![navigationsformular]![navigationunderformular]![searchfor] & ""*"", """" exit function end if søgefterfornavn_exit: exit function søgefterfornavn_err: msgbox error$ resume søgefterfornavn_exit
it keeps saying "syntax error: missing comma in query expression" don't understand? did wrong or?
you have forgotten put quote signs ("):
docmd.setfilter "søgnings forespørgelse", "[fornavn] ""*""" & [forms]![navigationsformular]![navigationunderformular]![searchfor] & """*"" or [cpr] ""*""" & [forms]![navigationsformular]![navigationunderformular]![searchfor] & """*"" or [efternavn] ""*""" & [formularer]![navigationsformular]![navigationunderformular]![searchfor] & ""*""", """"
you forgot them because need put quote character twice have in string (as escape character).
Comments
Post a Comment