473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cannot find field referred to

Ok, here is the scoop.

I have a report that I am designing. Now, the table that the data comes from, has an field called ATTRIBUTE. This field is populated with an R to indicate when a page break should occur. I then have this block of code to condition the page break:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. Me![CondPgBreak].Visible = False
  3.  
  4. If Me![ATTRIBUTE] = "R" Then
  5.  Me![CondPgBreak].Visible = True
  6.  End If
  7. End Sub
  8.  
  9.  
This works beautifully..

Now, due to design issues, I have had to add a new field called PAGEFLAG, and now my R references for the page breaks occur in that field. I have updated the query that the report pulls from to add this new field. When I run the query everything is fine. However when I try running the report with the code changed to reflect the new field to use, :

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. Me![CondPgBreak].Visible = False
  3.  
  4. If Me![PAGEFLAG] = "R" Then
  5.  Me![CondPgBreak].Visible = True
  6.  End If
  7.  
  8. End Sub
  9.  
I now get a run time error saying that the field in the expression could not be found.

Exact error is: Graphics.mdb can't find the field 'PAGEFLAG' referred to in your expression. Runtime error 2465


I am confused... Please help me
Mar 27 '08 #1
2 4278
Stewart Ross
2,545 Expert Mod 2GB
Hi. From what you say, the most likely explanation is that you have not included the field PAGEFLAG as a control on your report, or if you have included it you have changed its name to something else.

Me![PAGEFLAG] is interpreted as 'the value of the control named PAGEFLAG on the current report'. It does not mean 'the field called PAGEFLAG in the recordsource query'.

If there is no control with this name on your report a run-time error will result, as you are finding. If the field is indeed missing drag a copy of the PAGEFLAG field onto your report from the report's field list. If you do not want to print it set its Visible property to No.

-Stewart
Mar 27 '08 #2
Hi. From what you say, the most likely explanation is that you have not included the field PAGEFLAG as a control on your report, or if you have included it you have changed its name to something else.

Me![PAGEFLAG] is interpreted as 'the value of the control named PAGEFLAG on the current report'. It does not mean 'the field called PAGEFLAG in the recordsource query'.

If there is no control with this name on your report a run-time error will result, as you are finding. If the field is indeed missing drag a copy of the PAGEFLAG field onto your report from the report's field list. If you do not want to print it set its Visible property to No.

-Stewart

OK Thanks! I must have put the attribute control on there and hid it somehow as I could not find it any where on the design view, it is basically used as a reference point.. I will add the control to the report itself
Mar 27 '08 #3

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

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
6
by: Dirk Van de moortel | last post by:
Hi, We have a database with some tables with (what I would denote as) 'referred field names'. Like this: DataTable1 with fields F1, F2, F3 DataTable2 with fields F3, F4, F5 DataTable3 with...
2
by: Danny | last post by:
Hello I am trying to create a separate listbox and fill it with items based on what is in another field in a database. This field is bound to a field in the underlying database. But the data...
6
by: MLH | last post by:
"The following unexpected error occurred in Sub CopyMySQLbttn_Click, line #250, CBF on frmVehicleChooserform. 2465: "Can't find the field 'forms' referred to in your expression. You may have...
11
bhcob1
by: bhcob1 | last post by:
Hi, Whenever I delete a record my command button, the record deletes, a list displaying all records is updated and then a message box appears: Microsoft Access can't find the field 'I' referred to...
1
by: klaka | last post by:
Hello, Could u please help me with this error? Microsoft access can't find the field 'I' referred to in your expression or The field 'I' already exists It appears after an "Export to...
4
by: rlntemp-gng | last post by:
I have one module where I would like to launch 2 different forms (that do exist), based on a form object and string that is passed into it. (prmTable is a string, not a table object simply because...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
4
kcdoell
by: kcdoell | last post by:
Hello: I have the following afterupdate event: Private Sub GWP_AfterUpdate() 'Updates the Total calculation in the control "SumGWP" on the quick reference 'table that is located on the form...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.