Perfect, that seems to be just what I wanted thanks!
OK so moving on, I have identified another problem I'm not sure how to solve, this is my query:
Code:
SELECT StLars.[Journalnummer 1], StLars.[Journalnummer 2], [StLars].År, [StLars].[Efternamn], [StLars].[Förnamn], [StLars].Ålder, [StLars].År2, [StLars].Månad, [StLars].Dag, [StLars].[Födelselän/-ort], [StLars].Boendeort, [StLars].Yrke, [StLars].Utskriven, [StLars].Orsak, [StLars].AvdelningFROM StLars
WHERE (
(([StLars].År) Like "*" & Forms!Sok!inskrAr & "*" Or ([StLars].År) Is Null) And
(([StLars].[Efternamn]) Like "*" & Forms!Sok!Efternamn & "*" Or ([StLars].[Efternamn]) Is Null) And
(([StLars].[Förnamn]) Like "*" & Forms!Sok!Fornamn & "*" Or ([StLars].[Förnamn]) Is Null) And
(([StLars].Ålder) Like "*" & Forms!Sok!Alder & "*" Or ([StLars].Ålder) Is Null) And
(([StLars].År2) Like "*" & Forms!Sok!fAr & "*" Or ([StLars].År2) Is Null) And
(([StLars].Månad) Like "*" & Forms!Sok!fMan & "*" Or ([StLars].Månad) Is Null) And
(([StLars].Dag) Like "*" & Forms!Sok!fDag & "*" Or ([StLars].Dag) Is Null) And
(([StLars].[Födelselän/-ort]) Like "*" & Forms!Sok!fLan & "*" Or ([StLars].[Födelselän/-ort]) Is Null) And
(([StLars].Boendeort) Like "*" & Forms!Sok!boendeOrt & "*" Or ([StLars].Boendeort) Is Null) And
(([StLars].Yrke) Like "*" & Forms!Sok!Yrke & "*" Or ([StLars].Yrke) Is Null) And
(([StLars].Utskriven) Like "*" & Forms!Sok!utskrDatum & "*" Or ([StLars].Utskriven) Is Null) And
(([StLars].Orsak) Like "*" & Forms!Sok!orsak & "*" Or ([StLars].Orsak) Is Null)
);
Now this works for the moment, and I added these "Is Null" to get around the fact that many rows in the table have only some of the fields filled in at all. But now I run into the problem that, if I for example search for Yrke (Occupation): Lokförare (locomotive driver) I get all rows that feature that string in that field, but also all rows where that field is empty! It should only find those fields that have that string in it in that field. But when I search in name, I of course want to find all of the ones with that name, even if the Yrke-field is empty. I dont know how to phrase the question to accomplish this?
Thanks again for your help.