MS Access Forum / Macros / July 2007
Condition in MACRO
|
|
Thread rating:  |
Roadking - 25 Jul 2007 20:26 GMT I have been using this condition in Access2000 for years, no problem. DCount("*","OrderHeader")>0 Yet when I copy this in an Access2003 macro I get this message:
Microsoft Office Access can't parse the expression:'DCount("*","OrderHeader")>0'.
OrderHeader is a valid tablename.
What's wrong with the syntax or can there be another reason for this message?
Thanks for your response!
Steve Schapel - 25 Jul 2007 22:13 GMT Roadking,
I can't think of a reason for the error. Did you copy/paste this expression from somewhere else? If so, delete it and manually type it in. Sorry, but I have to ask... Are you sure you have this expression in the Condition column of the macro design? Then, clutching at straws, make a mew macro and test the same condition in there, see if you get the same thing.
 Signature Steve Schapel, Microsoft Access MVP
> I have been using this condition in Access2000 for years, no problem. > DCount("*","OrderHeader")>0 [quoted text clipped - 8 lines] > > Thanks for your response! Roadking - 25 Jul 2007 22:52 GMT Thanks for answering me, Steve. I did as you said, typed in the expression and made a new macro. The result was in both cases the same error. I have some screen shots, to show that I'm using the Condition column, but I don't see how I can attach them to this post.
Although I fail to see how this has anything to do with it, I'm working in an Access2003 database on a remote XP computer, connected via a VPN (Europe).
> Roadking, > [quoted text clipped - 17 lines] > > > > Thanks for your response! Steve Schapel - 27 Jul 2007 05:28 GMT Roadking,
I am sorry, I am at a loss to explain this. It appears that you have done it correctly. All I can suggest is some experimentation, to try and identify where the error is arising.
Can you make a new Access 2003 file, and try the same thing there?
Can you try by substituting the name of one of the fields in the query for the * in other words something like this: DCount("[NameOfAField]","OrderHeader")>0
Also, have a look at this... open the VB Editor window, and select References from the Tools menu, and see if any of the ticked items shows with the word "MISSING".
 Signature Steve Schapel, Microsoft Access MVP
> Thanks for answering me, Steve. > I did as you said, typed in the expression and made [quoted text clipped - 5 lines] > Although I fail to see how this has anything to do with it, I'm working in an > Access2003 database on a remote XP computer, connected via a VPN (Europe). Roadking - 27 Jul 2007 23:14 GMT Steve,
I did everything you suggested, same error. Nothing is missing in the references. Just to make sure, I asked them to check for updates. Everything was up to date. Next step is a new installation, I think.
> Roadking, > [quoted text clipped - 21 lines] > > Although I fail to see how this has anything to do with it, I'm working in an > > Access2003 database on a remote XP computer, connected via a VPN (Europe). Steve Schapel - 28 Jul 2007 10:32 GMT Roadking,
Your comment just triggered a random thought... You don't happen to have a foreign version of Access 2003 installed there do you? In which case, depending on language, it could be that it requires a ; rather than a , delimiter in the function arguments, i.e. DCount("*";"OrderHeader")>0
 Signature Steve Schapel, Microsoft Access MVP
> I did everything you suggested, same error. > Nothing is missing in the references. > Just to make sure, I asked them to check for updates. > Everything was up to date. > Next step is a new installation, I think. Douglas J. Steele - 28 Jul 2007 11:45 GMT Isn't that a function of what shows up as the List Separator in Regional Settings (on the Numbers tab), rather than being due to a "foreign version" of Access?
 Signature Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please)
> Roadking, > [quoted text clipped - 8 lines] >> Everything was up to date. >> Next step is a new installation, I think. Steve Schapel - 29 Jul 2007 23:32 GMT Thanks, Doug. I hadn't realised that, but seems obvious now that you mention it. :-)
 Signature Steve Schapel, Microsoft Access MVP
> Isn't that a function of what shows up as the List Separator in Regional > Settings (on the Numbers tab), rather than being due to a "foreign version" > of Access? Roadking - 30 Jul 2007 18:00 GMT Those darn Europeans with their funny List Separators ! Yes, Steve this was exactly the problem. Thanks for your help.
> Roadking, > [quoted text clipped - 10 lines] > > Next step is a new installation, I think. > >
|
|
|