A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

stLinkcriteria no longer working (since 2007 upgrade)



 
 
Thread Tools Display Modes
  #1  
Old June 7th, 2010, 04:28 PM posted to microsoft.public.access.reports
arathra
external usenet poster
 
Posts: 1
Default stLinkcriteria no longer working (since 2007 upgrade)

We have just upgraded to 2007 and are having a few minor problems. I've seen
similar threads online but can't find the solution exactly for us.

If I open a report then it shows the report with ALL the records.

If I open it with a button with this code, it shows ALL the records:

Dim stDocName As String
stDocName = "rCertificate"
DoCmd.OpenReport stDocName, acPreview

However, the moment I add stLinkcriteria it fails. This used to work under
the old Access but simply won't work now, i.e. NO records show up:

Dim stDocName As String
stDocName = "rCertificate"
stLinkCriteria = "[fIDNumber]='" & Me![fIDNumber] & "'"
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

fIDNumber is an alphanumeric string (hence the single quotes around it).

I have no idea what is wrong with it and can only assume that it's due in
part to a change in Access.

Ads
  #2  
Old June 7th, 2010, 04:37 PM posted to microsoft.public.access.reports
Jörn Bosse[_3_]
external usenet poster
 
Posts: 20
Default stLinkcriteria no longer working (since 2007 upgrade)

Well,

the code seems fine if the criteria really is a string.
Did you already tried to create a new form with the same recordsource?

Regards
Jörn

Am 07.06.2010 17:28, schrieb arathra:
We have just upgraded to 2007 and are having a few minor problems. I've seen
similar threads online but can't find the solution exactly for us.

If I open a report then it shows the report with ALL the records.

If I open it with a button with this code, it shows ALL the records:

Dim stDocName As String
stDocName = "rCertificate"
DoCmd.OpenReport stDocName, acPreview

However, the moment I add stLinkcriteria it fails. This used to work under
the old Access but simply won't work now, i.e. NO records show up:

Dim stDocName As String
stDocName = "rCertificate"
stLinkCriteria = "[fIDNumber]='"& Me![fIDNumber]& "'"
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

fIDNumber is an alphanumeric string (hence the single quotes around it).

I have no idea what is wrong with it and can only assume that it's due in
part to a change in Access.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2004-2018 OfficeFrustration.
The comments are property of their posters.