Pretty confusing post.
These conditions are the same:
"based on the condition that if the username= %username then true. otherwise it selects all the values in the database for txtusername"
True means don't filter, so you would get everything.
If the field (I assume that you mean the parameter field) is not prepopulated, then it's more difficult to assure, especially since you didn't share your Crystal version nor how you are running the report, keep in mind that basic technical information is important.
BTW, the select expert is used for simple solutions, use the report->edit selection formula->record for advanced functionality (again, the menu might differ depending upon your Crystal version).
You might try the following:
(
if not(isnull({?myparm}))
or
trim({?myparm}) <> "" then
{table.field} = {?myparm}
else
if isnull({?myparm})
or
trim({?myparm}) = "" then
true
)
-k