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
Solved

converted Macro to Code, get error

Posted on 2013-12-07
2
567 Views
Last Modified: 2013-12-07
Experts,

I have a form with an Onclick event.
The event is in the form of a macro.
It works fine.  

I converted the macro to code and now get an error on the OnClick event of that same form.  
"TempVars can only Store data.  They can not store objects"
(actually I converted the macro in another db then copied and pasted from that db to the current db as didnt want to convert all macros to code in current db...if that matters)
I didnt do anything else except convert macro to code.

posted pic.

Let me know what you think as to why I get the error.

error,After Converted to code
0
Comment
Question by:pdvsa
2 Comments
 

Author Comment

by:pdvsa
ID: 39703727
here is the macro before converted (collapsed all)

Macro, before converted
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39703730
this
tempvars.add "CurrentID",ID


should be

tempvars.add "CurrentID", me.ID.value
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

828 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