473,325 Members | 2,805 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,325 software developers and data experts.

FindRecord in subform?

176 100+
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
3 2520
MMcCarthy
14,534 Expert Mod 8TB
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
Michael R
176 100+
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
14,534 Expert Mod 8TB
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

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

Similar topics

0
by: seeker52 | last post by:
When I use findrecord the record found appears at the bottom of the datasheet. Is there a way to force it to appear in the middle of the sheet. seeker53
1
by: Stu Mac | last post by:
Hi I have a table with two fields Key Info 1 a 2 b 3 c
1
by: Doug W. | last post by:
I want to merge just one record from a query in my Access database into a Word document. This allows me to send one letter to one client by first extracting the client's address data, personal...
7
by: 4004 | last post by:
Where am I going wrong? I have a form which has a record for each date on which I teach. It has a subform which shows the classes that I teach that day. So I want to be able to click on a...
6
by: ashatzen | last post by:
I'm using the "DoCmd.FindRecord" method and it's working fine. But if there aren't any records to be found at all, I get a: "You can't use Find or Replace now" error message. How do I stop that error...
1
by: Keith Wilby | last post by:
When I run this line of code from a command button on a form DoCmd.FindRecord "Domestic FW System", acStart, , acDown, , acCurrent I get the error "A macro set to one of the current field's...
4
by: RAG2007 | last post by:
Hi Having some problems with docmd.findrecord, getting runtime error 2162, in an adp, sql server back end. On my main form, I have a continuous view subform giving a list of subrecords within...
0
by: Ben Lahoy | last post by:
Hi! My problem is basically in a search modal window, where the user is allowed to make a selection on which option to take. After selecting an option and then giving the data to search, the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.