Solved

MS Access 2010 - Use code behind to open another form passing the primary key to it

Posted on 2014-02-05
4
682 Views
Last Modified: 2014-02-05
I am working on a dbase that was given to me.  The dbase used macros.  I took the project list form and changed it to not allow addition, deletions, edits.  I also converted the macro to code.

With the macro and the code now a Msg Box pops up asking for a parameter value.  This happened as soon as I changed the form setting to prevent addition, deletions and edit.  

I want any changes to be performed in the project details form.  

How can I stop that msg box from opening?
Project-List-Issue.jpg
Project-List-Issue-Code-Behind.jpg
Project-List-Issue-Code-Behind-2.jpg
0
Comment
Question by:CipherIS
[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
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39837721
Those parameter prompts often mean that a field name is incorrect or unknown.

Take a look at the design of the table or query behind the form you are opening, and make sure that the field you are trying to match is indeed [ID] and not [ProjectID] or something similar, in which case the Where Condition argument in the OpenForm statement would be:

"[ProjectID] = "  & Nz(ID,0)

Open in new window



As an aside, its easier for us to help you if you post code snippets right in your questions, rather than screenshots of code.  Actual code lets us use your code in our comments more readily.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 39837731
Thank You.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39837735
that prompt appears, because there is no field named "ID" in the
Record Source of the form  "Project Details".

check and replace "ID" with the correct name of the field
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39837744
Glad to help :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

729 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