?
Solved

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

Posted on 2014-02-05
4
Medium Priority
?
686 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 2000 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

800 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