Runtime Error 2465 can't find the field (MS Acess 2003) (1 Viewer)

patelr26

New member
Local time
Yesterday, 17:38
Joined
Jul 14, 2008
Messages
5
Hi,

I need help. I am having problems with runtime error 2465 can’t find the field ‘frmSearchCoName_Subform’ referred to in your expression. (‘frmSearchCoName_Subform’ is the name of the subform in my main form)
Below is the code.

I am trying to find record in the main form based on the textbox value (CoCode) in the subform.

I have the subform inside the Main Form
MainForm Name: FindSearch
SubForm Name: frmSearchCoName_Subform
TextField Name: CoCode (in subform frmSearchCoName_Subform) (DataType Text)
TextField Name: Sales Order (in Main Form FormSearch) (DataType Text)
TextField Name: Co Code (in Main Form FormSearch) (DataType Text)

Private Sub CoCode_DblClick(Cancel As Integer)
DoCmd.ShowAllRecords
Me![Sales Order].SetFocus
DoCmd.FindRecord Me!frmSearchCoName_Subform.Form!CoCode

Thank You

 

maxmangion

AWF VIP
Local time
Today, 01:38
Joined
Feb 26, 2003
Messages
2,805
Hi,

check out this link how you should reference controls between forms/subforms
 

KenHigg

Registered User
Local time
Yesterday, 20:38
Joined
Jun 9, 2004
Messages
13,327
You may have to do something like:

DoCmd.FindRecord forms!frmSearchCoName_Subform.Form!CoCode

??

or

dim strCode
strCode = Me!frmSearchCoName_Subform.Form!CoCode
DoCmd.FindRecord strCode

???
 

Users who are viewing this thread

Top Bottom