473,385 Members | 1,712 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,385 software developers and data experts.

Miscrosoft Access Cant Find The Field "|" referred to in your expression.

Good day,

now i know that someone was having the same error message and i read the thread but didnt help me out too much!

so basically i have a command button that on a form that needs to open another form and give me the details of the current record that was selected on the previous form.

here is the code i am using:
Expand|Select|Wrap|Line Numbers
  1. Private Sub ouvrir_détails_location_Click()
  2. On Error GoTo Err_ouvrir_détails_location_Click
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6.  
  7.     stDocName = "Formulaire Locations"
  8.     ' Nom du formulaire qui sera ouvert par le bouton  "Voir Détails Location"
  9.  
  10.     stLinkCriteria = "[NoLocation]=" & [Sous-formulaire Clients]![NoLocation]
  11.     ' Attribution de la valeur active du champ "NoLocation" du "Sous-formulaire Clents"
  12.     ' au champ du même nom dans le "Formulaire Location", qui sera utilisé comme
  13.     ' critère de recherche
  14.  
  15.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  16.     ' Recherche effectuée dans le formulaire ouvert en rapport au critère établi précédemment
  17.  
  18. Exit_ouvrir_détails_location_Click:
  19.     Exit Sub
  20.  
  21. Err_ouvrir_détails_location_Click:
  22.     MsgBox Err.Description
  23.     Resume Exit_ouvrir_détails_location_Click
  24. End Sub

any help would be very appreciated
thanks in advance
Mar 2 '07 #1
7 2772
MMcCarthy
14,534 Expert Mod 8TB
What is the data type of [NoLocation]?

Does the form open OK if you remove the criteria?
Mar 2 '07 #2
What is the data type of [NoLocation]?

Does the form open OK if you remove the criteria?
the data type of [NoLocation] is Autonumber and the form opens up just fine
when removing the criteria.

thanks for responding so quickly.
Mar 2 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
the data type of [NoLocation] is Autonumber and the form opens up just fine
when removing the criteria.

thanks for responding so quickly.
OK one more question.

Is [Sous-formulaire Clients] the name of the current form or another open form?
Mar 2 '07 #4
OK one more question.

Is [Sous-formulaire Clients] the name of the current form or another open form?
its the name of the subform within the current form.
the record thats to be selected for the information is in the subform within the current form.

i hope im making sense...

thanks again
Mar 2 '07 #5
MMcCarthy
14,534 Expert Mod 8TB
Try this ...

Expand|Select|Wrap|Line Numbers
  1. stLinkCriteria = "[NoLocation]=" & Forms![MainFormName]![Sous-formulaire Clients].Form![NoLocation]
  2.  
Substitute the name of your main form for [MainFormName]

Mary
Mar 2 '07 #6
Try this ...

Expand|Select|Wrap|Line Numbers
  1. stLinkCriteria = "[NoLocation]=" & Forms![MainFormName]![Sous-formulaire Clients].Form![NoLocation]
  2.  
Substitute the name of your main form for [MainFormName]

Mary
Thank you so much for all your help its finally working now!
again thank you! great website!
Mar 3 '07 #7
MMcCarthy
14,534 Expert Mod 8TB
Thank you so much for all your help its finally working now!
again thank you! great website!
You're welcome.
Mar 3 '07 #8

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

Similar topics

1
by: JMCN | last post by:
hello i receive a runtime error '2465' whenever i run my module in access 97. it says 'Run-time error '2465' OOB Reports can't find the field "DuplicatePayments' referred to in your...
6
by: John Baker | last post by:
Hi: As those who have looked at this newsgroup recently will realize, I am a neophyte with Access, although I have experienced with Approach (the Lotus product). There are things I could easily...
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...
5
by: CindySue | last post by:
I'm using a subform linked to the main form by a bidder number field. In the subform, I added a group header and put the field LS in it so that it would list all records designated as Live first...
4
by: dougmeece | last post by:
Hello everyone, I have created a search button but I receive the message "Microsoft Access can't fine the field "|" referred to in your expression" when I try to use it. I have looked online for...
2
by: bhughes2187 | last post by:
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...
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...
4
by: zufie | last post by:
I have a main form containing a command SEND button that prompts an email form to pop up. The email address(es) that are supposed to appear on the email form are those corresponding to the...
2
by: shalskedar | last post by:
I 've created Report in Ms access which contains subform.The field value in the report is retrieved from the subform.When this report is exported,it shows the error as The expression you entered has...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.