Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sync two subforms on a main form errors

Status
Not open for further replies.

Bubba02

Technical User
Jan 25, 2005
7
0
0
US
I see a way of doing just what I need with input from MajP in thread702-1201740 to sync two subforms on a main form. However, I seem to keep getting the following error:

Runtime Error ‘2465’:
Microsoft Office Access can’t find the field ‘txtBxBtoC’ referred to in your expression.

I've added a text box control to my main form named 'txtBxBtoC', and I've added the following code to the OnCurrent event in my subformB:

Private Sub Form_Current()
Me!txtBxBtoC.Value = Me![qryIS-1.Link2].Value
End Sub

Is there a syntax error or referencing error here?

My pertinent information:
Main form is frmIS-31a
SubformB is subfrmIS-3a
SubformC is subfrmIS-3-Changed
SubformB and SubformC should link (master to child, respectively) as:
"qryIS-1.Link2" to "RecordNumber"

Any help is greatly appreciated.


 
You may try something like this:
Forms![name of mainform]!txtBxBtoC.Value = Me![qryIS-1.link2].Value

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV!
That did the trick!

I also found that looking at this situation from the main form, by defining the text box Control Source property to:
=[subfrmIS-3a].[Form]![qryIS-1.Link2]
that seems to work also.

Would either of these be a preferred way of synchronizing, for performance or flexibility, etc.?

I do appreciate your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top