Error in formula <Record_Selection>. AND GROUP IN NEW PAGE

dear all
i have table students ( student_no , student _ name _student_location_Register_date, Student_country, Student_nationality )

i uam using vb6 and crystal report 7


i make the report with 4 groups
group 1= nationality
group 2= country
group 3=Locatioin
group 4=Student Number

and i call the report from the vb6 every thing is ok
no problems there

now if i make selection formula for  any field it give me error

?err.Description
Error in formula  <Record_Selection>.
'
'
The remaining text does not appear to be part of the formula.

this error drive me crazy always in grouping report

if i remove the selection formula
the  report run without any problems



AND HOW I CAN MAKE EACH GROUP IN NEW PAGE ????


any idea
thanx



LVL 4
abdulhameedsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FER_GCommented:
could you put the selection formula to see if this has any error...
For the groups, you must enter to the section expert of each group and set "New page before" checkbox

Regards...
FerG
--
Saludos.
Ing. Fernando D. Giletta
San Fco. Cba. Arg.
0
abdulhameedsAuthor Commented:

    rpt.WindowShowCloseBtn = True
    rpt.WindowShowPrintSetupBtn = True
    rpt.WindowShowSearchBtn = True
    rpt.ReportFileName = App.Path & "\SalesAnalisys.rpt"
   
   
    'nothing
   If MaskEdBox1.Text = "__/__/____" And Text1.Text = "" Then
   
   End If
   
   
      'date
   If MaskEdBox1.Text <> "__/__/____" And Text1.Text = "" Then
   rpt.SelectionFormula = "{rpt_salesAnqalysis.Date} in DateTime (2007, 01, 12,00, 00, 00) to DateTime (" & Format(mask2.Text, "yyyy ,mm ,dd") & ")"
   End If
         
   
   
    rpt.Connect = "dsn = erp"
    rpt.DiscardSavedData = True
    rpt.WindowState = crptMaximized
    rpt.Action = 1
    rpt.Destination = crptToWindow

SalesAnalisys.txt
0
FER_GCommented:
Can you prove the next line?...
rpt.SelectionFormula = "{table.field} >= DATE(2007,01,12) AND  {table.field} <= DATE(2007,12,12)"

(prove this 2 fixed dates, so you can know if the code works)
I don't know if your table name is "rpt_salesAnqalysis" and the fieldName is "Date", so you must know that you must put {TableName.FieldName} to filter the records...

And I always use...

rpt.Connect = "dsn = erp"
rpt.ReportFileName = App.Path & "\SalesAnalisys.rpt"
rpt.SelectionFormula = ...
rpt.DiscardSavedData = True
rpt.WindowState = crptMaximized
rpt.WindowState = crptMaximized
rpt.Destination = crptToWindow
rpt.Action = 1

IN this order...


FerG
--
Saludos.
Ing. Fernando D. Giletta
San Fco. Cba. Arg.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

abdulhameedsAuthor Commented:
FER_G: thank you i will try and i will inform u
0
FER_GCommented:
YOU'RE WELCOME, I HOPE THAT IT COULD HELP YOU
0
mlmccCommented:
You might also try

 rpt.ReplaceSelectionFormula = "{rpt_salesAnqalysis.Date} in DateTime (2007, 01, 12,00, 00, 00) to DateTime (" & Format(mask2.Text, "yyyy ,mm ,dd") & ")"

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
abdulhameedsAuthor Commented:
FER_G
and i use the order you give it to me up also the same problem
when i  make fixed firmula it give me error so its not runnig  


0
abdulhameedsAuthor Commented:
mlmcc

when i use this
rpt.ReplaceSelectionFormula = "{rpt_salesAnqalysis.Date} in DateTime (2007, 01, 12,00, 00, 00) to DateTime (" & Format(mask2.Text, "yyyy ,mm ,dd") & ")"

it give me error argument  not  optional
0
abdulhameedsAuthor Commented:
see this
untitled.bmp
0
abdulhameedsAuthor Commented:
the ereport pic
untitled.bmp
0
abdulhameedsAuthor Commented:
thanks all for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.