Solved

What is the vba to open a split form to a certain record?

Posted on 2013-06-17
3
315 Views
Last Modified: 2013-06-18
When a user double-clicks on a record in a subform,  I want a split form to open showing all the invoice records for that project but the top part showing the particular invoice that they clicked on. At the moment I have:

DoCmd.OpenForm "frmInvoice", , , "[ProjectID]=" & Me.ProjectID

and this opens showing all the invoices for that project but the particular invoice they want is not showing in the top part. I want to reference the top part as something like

"[InvoiceID]=" & me.InvoiceID

Thanks
0
Comment
Question by:onewheelhk
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 39255420
You can use this as your next command:

DoCmd.SearchForRecord acDataForm , "frmInvoice", acFirst , "[InvoiceID] = " & Me!InvoiceID & ""

/gustav
0
 
LVL 1

Author Closing Comment

by:onewheelhk
ID: 39255449
Fantastic. That works great. Thanks.
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39255453
You are welcome!

/gustav
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help writing a query 6 73
Sub Reports 8 22
Web based Access Database and licencing 5 29
Licensing Sharepoint 2016 for developers 11 30
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now