Solved

Why form won't open to a selected record

Posted on 2013-05-31
2
550 Views
Last Modified: 2013-05-31
I have a form which the user can select a record from a combobox.  Then the following code is supposed to open the second form to the selected record.  Instead the 2nd form opens and all records are displayed.

???

Here's the code of the onclick event of the command button on the first form.

DoCmd.OpenForm "frmMatlsTransHeader", acNormal, , , acFormEdit, acWindowNormal, "[MatlsTransHeaderID]=" & Me.cboID

What am I doing wrong?
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 39212027
You passing it in the wrong argument.  Should be:

DoCmd.OpenForm "frmMatlsTransHeader", acNormal, , "[MatlsTransHeaderID]=" & Me.cboID

, acFormEdit, acWindowNormal

Jim.
0
 

Author Comment

by:SteveL13
ID: 39212033
Thanks.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

707 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