[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
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
?
690 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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

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.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
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 …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

656 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