I think you can add some code in the button_click event to open different report according to the text entered.
Or you can add more different buttons to make it simple to open particular report.
Do you mean VBA insted of vb6?
Don't use textbox. Use combo or list box that specifies the choices to user. User selects one of the items and code opens the selected report. Can be in the AfterUpdate event of control: DoCmd.OpenReport Me.cbxReports
hi, any1 tell me coding of date range that i entered in the textbox for open report.
pllllzzzzz
For a date value, use # instead of the single quote:
DoCmd.OpenForm "SecondFormName", , , "FieldName = #" & Me.ControlName & "#"
This is a web supplied by a guy in this forum,it's very useful.
http://www.baldyweb.com/wherecondition.htm
hi,
dear i m unable to do it. i wanna open report where i enter first date in textbox1 and second date in textbox2, and then click button then open all records of report from first date to second date( like 01-may-2011 to 15-may-2011).
thanks
Sorry for my last reply, that's too assiduous
Do you have a date field in the report? Try following code, I think it should work.
DoCmd.OpenReport ReportName, acViewPreview, , "Date>" & Me.textbox1.value & "And" & "Date<" & Me.textbox2.value
HI,
Dear error is coming
runtime error. '3075'
syntax error
'(dateofissue>25-apr-11anddateofissue<4may-11)'
coding is
DoCmd.OpenReport "statement", acPreview, , "Dateofissue>" & Me.Text106.Value & "And" & "Dateofissue<" & Me.Text108.Value
You still need the date delimiter, plus you missed some spaces, so try:
DoCmd.OpenReport "statement", acViewPreview, , "Dateofissue >=#" & Me.textbox1.value & "# And Dateofissue <= #" & Me.textbox2.value & "#"
DoCmd.OpenReport "statement", acViewPreview, , "Dateofissue >=#" & Me.textbox1.value & "# And Dateofissue <= #" & Me.textbox2.value & "#"[/QUOTE]
Thanks Paul.
The code you wrote is very brief.
thanks pbaldy.
but now blank report is opening. no records are there.
Since the syntax works, the problem may be the date problem.
Make sure your begin date and end date is correct or the records do exist.
Also make sure your dates are in US format:
http://access.mvps.org/access/datetime/date0005.htm
http://support.microsoft.com/default...b;en-us;210069
thank you very much.
dear, is it possible that i can add another textbox3 that has text in following coding
DoCmd.OpenReport "statement", acViewPreview, , "Dateofissue >=#" & Me.textbox1.value & "# And Dateofissue <= #" & Me.textbox2.value & "#"
I'm sorry I do not understand what you mean.
You want to add another textbox3 on your form and then?