Jan 03 2022 06:45 AM - edited Jan 03 2022 06:46 AM
Hello Experts,
I have the following OpenReport code:
DoCmd.OpenReport "rptPC", acViewReport, , "[DDNo]= " & Me.txtDrawNo
I need to modify it since [DDNo] is not a number...it's text.
There is another issue I need to take into account.
the [DDNo] has 2 letters appended to the front like this:
DD1
DD2
DD3...
I need to somehow ignore the DD part of the DDNo
The Me.txtDrawNo is a number and doesnt have the "DD" part appended.
if I can strip out the "DD" part of [DDNo] then I will be able to open the report.
How could the above DoCmd be modified to strip out the "DD" part of [DDNo]?
I hope that makes sense. Let me know if any questions.
thank you.
Jan 03 2022 07:45 AM
Solution
Try this and let us know if it is successful or not.
DoCmd.OpenReport "rptPC", acViewReport, , "[DDNo]= """ & Replace(Me.txtDrawNo, "DD","") & """"
Jan 03 2022 09:16 AM - edited Jan 03 2022 09:17 AM
Hi,
DoCmd.OpenReport "rptPC", acViewReport, , "DDNo='DD" & Me!txtDrawNo & "'"
Servus
Karl
************
Access News
Access DevCon
Jan 03 2022 01:18 PM
Jan 03 2022 01:19 PM
Jan 03 2022 07:45 AM
Solution
Try this and let us know if it is successful or not.
DoCmd.OpenReport "rptPC", acViewReport, , "[DDNo]= """ & Replace(Me.txtDrawNo, "DD","") & """"