Ms Access Run Time Error 2465 Subform
Contents |
Question Need help? Post your question and get tips & solutions from a community of 418,595 IT microsoft access can't find the field referred to in your expression Pros & Developers. It's quick & easy. Error 2465 when referencing
Run-time Error '2465' Application-defined
to a subform field P: 1 Pawel Hi everyone, I got this error in Access and I really access error 2465 can't find the field don't have any idea where it may come from... In a form with Clients ("DB Client companies - management"), I have a subform with contracted products ("DB Client companies products - management"). In this subform, there is a button with VBA code behind (OnClick). When it's executed, I get the following error (2465): Microsoft Access can't find the field 'DB Client companies products - management' referred in your expression. The code that produces the error is (it's the first line of the code): Expand|Select|Wrap|Line Numbers Me.[Range1price]=DLookup("[Range1price]","[SProductslist]","[SProductslist]![Productcode]=[Forms]![DBClientcompanies-management]![DBClientcompaniesproducts-management].[Form].[Productcode]") I really don't know why it appears, as I copy-pasted the code from other form (with the same expression structure, just different elements) and there it works... I use Access 2010 on Windows 7. I will be extremely grateful for help. Thanks in advance. Regards, Pawel Feb 13 '12 #1 Post Reply Share this Question 1 Reply Expert Mod 10K+ P: 14,534 MMcCarthy Try this and see if it works... Expand|Select|Wrap|Line Numbers Me.[Range1price]=DLookup("[Range1price]","[SProductslist]","[SProductslist]![Productcode]=[Forms]![DBClientcompanies-management]![DBClientcompaniesproducts-management].Form![Productcode]") Feb 13 '12 #2 reply Message Cancel Changes Post your reply Join Now >> Sign in to post your reply or Sign up for a free account. Similar topics Reference Form Fields Value - Application-defined Error 2465 VBA - Changing subform field's property from mainform button IE8 "Data Execution Prevention" error thrown when setting hidden field value Slight Changes cause Run Time Error 2465 Error 2465 - Can't find field 'forms' ??? Error msg when adding a new record to a subform Run-time error 2465 when opening subform Main Form Text Box Referencing a Subform Field acces
FAQ Community Top Posters Today's Posts Search Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rate Thread Display Modes 01-26-2012, 04:45 AM #1 Dorpicasso Newly Registered User Join Date: Jan 2012 Posts: 1 Thanks: 0 Thanked 0 Times in 0 Posts Run-time Error 2465: Access can't find the field 'sfrLeave' referred to in your expr. I am an intermediate user of Access and know next to nothing about VBA. After modifying an existing subform in my database, I started https://bytes.com/topic/access/answers/932090-error-2465-when-referencing-subform-field getting run-time error '2465' every time I try to open The form which contains that subform. When I click 'debug' it opens the VBA environment and shows exacltly where the "sfrLeave" is referred to in the code, but I don't know how to fix it and am afraid I will make more damage. Can anyone help me? Can this problem be fixed without messing with the VBA? Big thanks in advance, http://www.access-programmers.co.uk/forums/showthread.php?t=221174 D. Dorpicasso View Public Profile Find More Posts by Dorpicasso 01-26-2012, 06:30 AM #2 nanscombe Newly Registered User Join Date: Nov 2011 Location: Kent, UK. Posts: 1,082 Thanks: 0 Thanked 256 Times in 249 Posts Re: Run-time Error 2465: Access can't find the field 'sfrLeave' referred to in your e Is the Subform called "sfrLeave" and the subform control on the main form called "sfrLeave" as well? If they both have the same name it may cause problems. __________________ Nigel Ex Tactical Systems developer nanscombe View Public Profile Find More Posts by nanscombe 01-26-2012, 10:04 PM #3 boblarson Former Moderator Join Date: Jan 2001 Location: Oregon, USA Posts: 32,482 Thanks: 94 Thanked 1,781 Times in 1,565 Posts Re: Run-time Error 2465: Access can't find the field 'sfrLeave' referred to in your e Quote: Originally Posted by nanscombe Is the Subform called "sfrLeave" and the subform control on the main form called "sfrLeave" as well? If they both have the same name it may cause problems. Actually nanscombe that is an incorrect statement. In this case it actually makes it EASIER if both are named the exact same thing. If they are named different then you have to re
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more http://stackoverflow.com/questions/14780280/microsoft-access-cant-find-the-field-1 about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Microsoft Access can't find the field '|1' up vote 2 down vote time error favorite I keep getting a run time error '2465' when running a query via VBA in Access. Error: Microsoft Access can't find the field '|1' referred to in your expression I can't seem to find where this issue is occuring. Below is the VBA code that I'm currently using to requery a form. Dim Test As String Test = "*" & Combo161.Value Dim strSQL As String Dim strWhere As can't find the String strWhere = (Chr(34) + Test + (Chr(34))) 'MsgBox (strWhere) strSQL = "SELECT * FROM Test_Query WHERE TestID " & strWhere 'MsgBox (strSQL) [Form_Test (subform)].RecordSource = strSQL [Form_Test (subform)].Requery The TestID had a field formatting of text, rather than a number. Does this matter at all? sql vba access-vba runtime-error share|improve this question edited Feb 8 '13 at 19:58 bernie 74k9124138 asked Feb 8 '13 at 19:52 Muhnamana 49142446 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote accepted Try: Dim Test As String Test = "*" & Combo161.Value Dim strSQL As String Dim strWhere As String strWhere = (Chr(34) & Test & (Chr(34))) 'MsgBox (strWhere) strSQL = "SELECT * FROM Test_Query WHERE TestID Like " & strWhere 'To test 'Debug.print strSQL If this is a subform, then: Me.[Form_Test (subform)].Form.RecordSource = strSQL ''Not needed when changing record source ''Me.[Form_Test (subform)].Form.Requery You did not have an equals sign / Like and the concatenator in VBA is &, not +, using + can lead to problems with nulls, but in this case, I reckon the problen is the missing Like, that is TestID Like "*something" You can control the contents of a subform with a combo and a link field: share|improve thi