Guest_imported
New member
- Jan 1, 1970
- 0
Here is the problem. I have two forms. My main form is called General. and then I have another form called "Victim" I placed "Victim" as a subform into General and now I am trying to create a query. Here is the problem. I have that SQL code down below in a query called "Victim Query" the problem that is arising is when the user is in the General form (which contains the Victim subform) and types in information for Victim to be searched a box pops up that says "Enter Parameter Value" Forms.Victim.Last Name. I do not know why it is doing this. When I open the Victim Form by itself the query works fine, the problem only happens when I try to run the query from the General form. I have to be able to run the query within the General Form so if anyone has any idea how to fix the problem it would be greatly appreciated
SELECT [Victim].[Last Name], [Victim].[First Name], [Victim].[Res Add], [Victim].[Res Phn], [Victim].[Bus Add], [Victim].[Bus Phn], [Victim].[Race], [Victim].[Sex], [Victim].[Age], [Victim].[Occupation]
FROM Victim
WHERE ([Victim].[Last Name]=[forms].[Victim].[Last Name] Or [forms].[Victim].[Last Name] Is Null) and ([Victim].[First Name]=[forms].[Victim].[First Name] or [forms].[Victim].[First Name] is Null);
SELECT [Victim].[Last Name], [Victim].[First Name], [Victim].[Res Add], [Victim].[Res Phn], [Victim].[Bus Add], [Victim].[Bus Phn], [Victim].[Race], [Victim].[Sex], [Victim].[Age], [Victim].[Occupation]
FROM Victim
WHERE ([Victim].[Last Name]=[forms].[Victim].[Last Name] Or [forms].[Victim].[Last Name] Is Null) and ([Victim].[First Name]=[forms].[Victim].[First Name] or [forms].[Victim].[First Name] is Null);