Solved

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

Posted on 2013-06-17
3
316 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Documents and settings folder 30 77
Please explain the parts of these 2 LINQ expressions 3 29
Turn off MS Access Default=0 for Numerics 6 25
Dcount help 2 11
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

770 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