By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,397 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,397 IT Pros & Developers. It's quick & easy.

FindRecord in subform?

100+
P: 176
Ok, I have another question.

I have Form1 with subform1. (both have number identifications fields) I have Form2 with subform2 with the same structrues and the same tables behind them. I need a button in Form1 that will open Form2 in the same record number where Form1 is, both in for main form and the subform.

Is there a simple way to do it?

Thanks.
Dec 3 '06 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Ok, I have another question.

I have Form1 with subform1. (both have number identifications fields) I have Form2 with subform2 with the same structrues and the same tables behind them. I need a button in Form1 that will open Form2 in the same record number where Form1 is, both in for main form and the subform.

Is there a simple way to do it?

Thanks.
You need to set criteria on the form open command.

Expand|Select|Wrap|Line Numbers
  1. Dim stLinkCriteria As String
  2.  
  3.    stLinkCriteria = "[ID_Field]=" & Me.[ID_Field]
  4.  
  5.    DoCmd.OpenForm "Form2Name", , , stLinkCriteria
  6.  
Dec 3 '06 #2

100+
P: 176
You need to set criteria on the form open command.

Expand|Select|Wrap|Line Numbers
  1. Dim stLinkCriteria As String
  2.  
  3.    stLinkCriteria = "[ID_Field]=" & Me.[ID_Field]
  4.  
  5.    DoCmd.OpenForm "Form2Name", , , stLinkCriteria
  6.  
Thanks for your reply.

How does this bring me closer to finding a record in both the form and the subform?
Dec 5 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Thanks for your reply.

How does this bring me closer to finding a record in both the form and the subform?
Your subform has to be tied to your main form so by selecting the main form record the subform should change automatically.
Dec 5 '06 #4

Post your reply

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