SetValue (1 Viewer)

unipacinc

New member
Local time
Today, 15:38
Joined
May 21, 2015
Messages
8
I am trying to upgrade a Access 2000 database to Access 2010. THe developer I am using is having an issue with "setvalue" that was usedin the 2000 version and says Macros will have to be written for the hundreds of places this has been used in the database. Are there any other ways to accomplish this without all those modifications?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:38
Joined
Aug 30, 2003
Messages
36,125
What's the issue? I just tested in a 2010 db and SetValue worked fine.
 

unipacinc

New member
Local time
Today, 15:38
Joined
May 21, 2015
Messages
8
The database is pulling fixed data from a many macros and it isn't in 2010 when we convert. He says it's due to the "setvalue" and I am trying find some answers
 

unipacinc

New member
Local time
Today, 15:38
Joined
May 21, 2015
Messages
8
Developers quote "
There are whole bunch of macros that were developed in 2003 version which did not get converted to 2010 version and for which I I will have to manually re create them or convert them to use code instead of macro. The macro in question is particularly "SetValue" . This macro basically takes value from somewhere in the database and sets it as a value somewhere in the report. One example of that is those % values that were missing on that report which you showed me while I was at your office. that % value is coming from the database and polulating that particular field in the report. I looked around the database and there are whole bunch of places where the previous developer has used "SetValue" macro and so the task becomes pretty big."</SPAN>
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:38
Joined
Aug 30, 2003
Messages
36,125
Well, I haven't seen the db so I can't authoritatively say he's wrong, I can only say that the SetValue action still works in 2010. Make sure the database is being run from a trusted location or you've enabled code via the "Enable Content" button under the ribbon. No code or macro runs unless one of those 2 things is done.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:38
Joined
Feb 19, 2013
Messages
16,607
I don't use macros, but if setvalue is a standard function and a macro has been given the same name....
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:38
Joined
Aug 30, 2003
Messages
36,125
I don't use macros, but if setvalue is a standard function and a macro has been given the same name....

Since it worked before, I'm assuming that they are referring to the action, not the name. Like meaning "macros that use SetValue". Wouldn't be the first time I was wrong though.
 

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
From the comment in post #4 I'm assuming that you (unipacinc) are the client and you're avoiding paying more for the 'extra work' that your developer has identified?

Perhaps the path to the places where SetValue is getting/setting its value has changed or been altered. I don't think it has anything to do with the versions of Access.
 

unipacinc

New member
Local time
Today, 15:38
Joined
May 21, 2015
Messages
8
We paid him to do the upgrade and when we implemented it over the weekend everything loaded and looked good. When my staff arrived Monday morning and started using it the problems began. I am not faulting the programmer, he thought it was functioning but doesn't really know how it works. He spent some more time Monday night and came back with the comment I included in the post. I'm just trying to get some other ideas to address the problem. I appreciate any and all comments!
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:38
Joined
Feb 19, 2013
Messages
16,607
if something was working and then stops, then simply - something has changed in the meantime. most likely you have some invalid data, since it is unlikely you will have messed with the code.

just take a look at what MS says about setvalue here

https://msdn.microsoft.com/en-us/library/bb177384(v=office.12).aspx

in particular note this line - 3rd line down

Note This action will not be allowed if the database is not trusted. For more information about enabling macros, see the links in the See Also section of this article.

So - perhaps you just need to set trusted locations for each user?
 

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
CJ_London might be on to something. SetValue is one of the "unsafe action" macro actions in Access.

The developer is basically saying that he may have to re-create them (and I see no reason why) or convert them to code (which is a better option). But then again, as already stated, I feel that somewhere in the db, the path for one or both of the SetValue parameters has been altered somewhere if the root cause isn't to do with Trusted Locations. Perhaps SetValue is pointing to an object that no longer exists.
 

unipacinc

New member
Local time
Today, 15:38
Joined
May 21, 2015
Messages
8
All good points which I will forward to him. Since I am a child regarding Access I cannot answer most of your thoughts. I have pasted an example from the database.

Macro Name Condition Action
CalcSA IsNull([NoOut]) SetValue
IsNull([NoOutL]) SetValue
[DepthN]>=[DepthD] MsgBox Numerator of depth fraction must be less than deno ...
GoToControl AskScalable([Style],[Flute])=1 And [DepthN]<[DepthD]
SetValue Use functions in CalcBlank module to calculate Blank dimension
 

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
Any chance of uploading a screenshot of the macro? It will make things easier to understand.

NB: Because you have less than 10 post counts, "I think" (now Mods correct me if I'm wrong) you'll need to zip your image file before uploading it otherwise the site wouldn't approve it. Anything after 10 posts you can upload as normal.
 

unipacinc

New member
Local time
Today, 15:38
Joined
May 21, 2015
Messages
8
I can do better than that, I can let you see the whole database via dropsend. I am just hoping that someone in the world can say this can be done without too much trouble. Since there don't seem to be many people around that still work with Access, that I can find. We are running the system on Windows 7 currently and still running Access 2000 for the database. We just want to upgrade it to a new version so we don't have problems down the road. It has been operating well since Windows 98 and my friend that wrote the original program has passed away.
 

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
Even better! I hope that with Dropsend one doesn't need to register to download the file?

There are still lots of developers out there who develop for various Access versions ;)

Just ensure that there's no personal data on it, it contains some test records and you point where to look.
 

unipacinc

New member
Local time
Today, 15:38
Joined
May 21, 2015
Messages
8
There will be data there, but nothing financial or that we would be concerned with. The only way I know is to email you a link, so I would need your email or one I could send the link.
 

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
You can send me a Private Message on here by clicking my name and looking through that page for a link to send a PM.

I'm sure that everyone else here who has contributed to this thread would want a copy too so I suggest you PM them too. Or better still just paste the link here for everyone to see.
 

Users who are viewing this thread

Top Bottom