@ItsMe
Originally Posted by
ItsMe
Why are you using a colon within your where clause?
The ":=" is called a "Named Argument".
From Help:
named argument
An argument that has a name that is predefined in the object library. Instead of providing a value for each argument in a specified order expected by the syntax, you can use named arguments to assign values in any order. For example, suppose a method accepts three arguments:
DoSomeThing namedarg1, namedarg2, namedarg3
By assigning values to named arguments, you can use the following statement:
DoSomeThing namedarg3 := 4, namedarg2 := 5, namedarg1 := 20
Also see: http://bytes.com/topic/access/insigh...amed-arguments
@casinc815
I too would like to see the code.
From your description, I think you have a design issue that is going to bite you in the end. (pun intended )
Each report is based on a query and the criteria for each query is the same, the student's name. An Input box allows for the entry of the name and is then parsed to extract the LastName and the First name.
Instead of the input box, I would use two text box controls (FName & LName) on the form. Saves a LOT of parsing and the query or code can refer to the controls to get the student name without asking every time the student name is required. Much easier....
There are a couple of changes you should/could make:
You have:
Code:
FullName = "StudentName = " & "'" & LastName & ", " & FirstName & "'"
The RED is not needed
Code:
FullName = "StudentName = '" & LastName & ", " & FirstName & "'"
Code:
DoCmd.OpenReport ("rpt_WTWResults"), , , WhereCondition:=FullName
DoCmd.OpenReport ("rpt_FountasP"), , , WhereCondition:=FullName
Since you are using named arguments, you don't need the commas.
Code:
DoCmd.OpenReport ("rpt_WTWResults"), WhereCondition:=FullName
DoCmd.OpenReport ("rpt_FountasP"), WhereCondition:=FullName