By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,563 Members | 905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,563 IT Pros & Developers. It's quick & easy.

Problem with printing a selected record in a form

100+
P: 222
Hello everybody


The name of the form that I'm working on is 'AddProduct' I'm trying to print a selected record that I have the focus, its name is "barecode"

My report name is 'barecodeprint' that contains a text box called 'barecoderepo'

I need to open the report with critiria 'barecode' ='barecoderepo' I'm using this code



Dim stDocName As String
Dim stlinkcriteria As String
stDocName = "barecodeprint"
stlinkcriteria = "[barecoderepo]='" & Me![barecode] &"' "
DoCmd.OpenReport stDocName, acPreview, , stlinkcriteria


Guys I spent maybe more than hours to be sure from all names above and I'm always getting in input box written on it [barecoderepo]....

Both text box are text

Can someone know something about this problem ... THank you
Jun 3 '07 #1
Share this Question
Share on Google+
8 Replies

JConsulting
Expert 100+
P: 603
Hello everybody


The name of the form that I'm working on is 'AddProduct' I'm trying to print a selected record that I have the focus, its name is "barecode"

My report name is 'barecodeprint' that contains a text box called 'barecoderepo'

I need to open the report with critiria 'barecode' ='barecoderepo' I'm using this code



Dim stDocName As String
Dim stlinkcriteria As String
stDocName = "barecodeprint"
stlinkcriteria = "[barecoderepo]='" & Me![barecode] &"' "
DoCmd.OpenReport stDocName, acPreview, , stlinkcriteria


Guys I spent maybe more than hours to be sure from all names above and I'm always getting in input box written on it [barecoderepo]....

Both text box are text

Can someone know something about this problem ... THank you
what's the name of the field that your textbox uses in the underlying recordsource? That's what goes into the [ ]
Jun 3 '07 #2

100+
P: 222
what's the name of the field that your textbox uses in the underlying recordsource? That's what goes into the [ ]

It is [barecoderepo] the name of the textbox on the report ...
Jun 3 '07 #3

JConsulting
Expert 100+
P: 603
It is [barecoderepo] the name of the textbox on the report ...
What version of Access are you using?
Jun 3 '07 #4

JConsulting
Expert 100+
P: 603
It is [barecoderepo] the name of the textbox on the report ...
try
DoCmd.OpenReport stDocName, acViewPreview, , stlinkcriteria
Jun 3 '07 #5

100+
P: 222
the same problem using
DoCmd.OpenReport stDocName, acViewPreview, , stlinkcriteria



Access version is 11.5614.5606 office 2003


Man the report that i'm using contains some special FONT barecode FONT ... Does this font are related to like these problems ...?

I tried a macro using DOCMD.OPENREPORT .. It isnot working too but it works for other report ...
Jun 3 '07 #6

JConsulting
Expert 100+
P: 603
the same problem using
DoCmd.OpenReport stDocName, acViewPreview, , stlinkcriteria



Access version is 11.5614.5606 office 2003


Man the report that i'm using contains some special FONT barecode FONT ... Does this font are related to like these problems ...?

I tried a macro using DOCMD.OPENREPORT .. It isnot working too but it works for other report ...
Yes, I can see where that would make a difference, however, the error you're getting points to only one conclusion..the name of the field you're trying to filter isn't on the report. That's why I asked what the "field" name, vs what the name of the textbox was. They can be different. The where clause in the openreport command uses the field name of the source of your report and not the textbox name.
J
Jun 3 '07 #7

100+
P: 222
Man I like your BRAIN ... Finally after 3 hours of [textname] verification it workes thank you ....:)
Jun 3 '07 #8

JConsulting
Expert 100+
P: 603
Man I like your BRAIN ... Finally after 3 hours of [textname] verification it workes thank you ....:)
Sorry I wasnt clear earlier. Glad you got it going.
J
Jun 3 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.