Form and url variables - making them the same name
I have a form that is entered when the user enters a part number. Inside the form, I do a bunch of query lookups using the form variabe, where partNumber = '#form.partNumber#'
However, I can also access this form from other forms, so I would then be using the url variable, where partNumber = '#url.partNumber#'
To determine whether I use the form or url variable, I pass a flag as I enter the form, and the check to determine which to use. For example, <cfif flag="form">, then where partNumber '#form.partNumber#" else where partNumber = '#url.partNumber#'
This seems to work ok, but is there a better way to do this ?
I just want to say where partNumber = '#partNumber#' and forget if it is form or url variable.