Results 1 to 14 of 14
  1. #1
    Join Date
    Feb 2004
    Posts
    5

    Unhappy Unanswered: Function You Entered Can't Be Used in This Expression

    Hi All,

    I am a new member here and have a very strange problem. Just so you know where I'm coming from, I have been building MS Access databases for several years, but I have no formal programming training and I am completely self-taught. I have the benefit of using several databases created by "real" programmers and I have learned a lot from them. My databases work pretty well, altho I am sure that they could be more streamlined if I knew what I was doing!

    I'm using MS Access 97 on a Windows NT 4.0 system. We are on a LAN and there are many users. I use Access 2000 at home and occasionally create a db there and convert it to 97 for use at work. I think this might be related to my problem.

    I have a simple process attached to the BeforeUpdate event on a form. It checks to see if the record has been changed and if it has, asks the user if they want to save their changes. If they say yes, the changes are saved, but I also have a little form pop up where they enter their initials and click OK. At that point, their initials are added to the record AND the "update" date is changed to the current date. This all works beautifully on a different database, and all the users of that database have no trouble.

    However, for this new database, users are getting the error message 2426 with the text as shown in the Subject Line to this posting. When they click ok on the error box, they get a run-time error that basically shows the macro that updates the date is not working. The initials are updated just fine, but the date is not updated.

    The strangest part of this is that it works JUST FINE on my workstation. For at least 2 other people, they get the error. I expect to hear from more as they start using it.

    Could this be related to having started this database on Access 2000 and converted to 97? If so, if I start a new Access 97 database and import the objects into it, would that solve the problem, or would the problem just be imported as well?

    I wondered if perhaps various users have different installations of Access, but the problem with that theory is that this exact same function works beautifully in a different database for the very users who cannot make it work in this database.

    I would very much appreciate anyone's thoughts on this strange issue.

    Thanks,
    Sandy

  2. #2
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: Function You Entered Can't Be Used in This Expression

    Originally posted by sandy2138
    Hi All,

    I am a new member here and have a very strange problem. Just so you know where I'm coming from, I have been building MS Access databases for several years, but I have no formal programming training and I am completely self-taught. I have the benefit of using several databases created by "real" programmers and I have learned a lot from them. My databases work pretty well, altho I am sure that they could be more streamlined if I knew what I was doing!

    I'm using MS Access 97 on a Windows NT 4.0 system. We are on a LAN and there are many users. I use Access 2000 at home and occasionally create a db there and convert it to 97 for use at work. I think this might be related to my problem.

    I have a simple process attached to the BeforeUpdate event on a form. It checks to see if the record has been changed and if it has, asks the user if they want to save their changes. If they say yes, the changes are saved, but I also have a little form pop up where they enter their initials and click OK. At that point, their initials are added to the record AND the "update" date is changed to the current date. This all works beautifully on a different database, and all the users of that database have no trouble.

    However, for this new database, users are getting the error message 2426 with the text as shown in the Subject Line to this posting. When they click ok on the error box, they get a run-time error that basically shows the macro that updates the date is not working. The initials are updated just fine, but the date is not updated.

    The strangest part of this is that it works JUST FINE on my workstation. For at least 2 other people, they get the error. I expect to hear from more as they start using it.

    Could this be related to having started this database on Access 2000 and converted to 97? If so, if I start a new Access 97 database and import the objects into it, would that solve the problem, or would the problem just be imported as well?

    I wondered if perhaps various users have different installations of Access, but the problem with that theory is that this exact same function works beautifully in a different database for the very users who cannot make it work in this database.

    I would very much appreciate anyone's thoughts on this strange issue.

    Thanks,
    Sandy
    Just a quick question and comment.

    Have you compiled the code in the 97 database after converting? I find that I catch a lot there.

    I have worked in Access 2 through 2003 and have had similar problems with things that have been converted. I would definitely try the import deal as an experiment.

    Never seen your specific problem though.

    Gregg

  3. #3
    Join Date
    Feb 2004
    Posts
    5
    Gregg,

    Thanks for your reply. Yes, I have done the Save - Compile process, with no luck. I'll try the import. Thanks!

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i'll poke my nose in since it's quiet today.

    "works fine for a given user in one application but not in another" is a classic references symptom (...though i would expect a different error message). references are local to each application (as opposed to each machine or each access installation).

    try a browse for missing references.

    izy
    currently using SS 2008R2

  5. #5
    Join Date
    Jan 2004
    Posts
    184

    Re: Function You Entered Can't Be Used in This Expression

    I just wanted to share with you a control featured on download.com that I have been using that has made my life easier:

    http://download.com.com/3000-2404-10...ml?tag=lst-0-1

    After selecting the CursorType, CursorLocation, LockType and Disconnected status of your Recordset (there are defaults). I bind my controls and that is it All the complexities of ADO are hidden from the user which is you.

    Then I can Navigate, Add New, Delete, Refresh, Search and Save Changes to my recordsets without any other code. That is really it, no other code is needed.

    This works in any environment VB, Access, VC++ etc...

    Let me know what you think.

    Originally posted by sandy2138
    Hi All,

    I am a new member here and have a very strange problem. Just so you know where I'm coming from, I have been building MS Access databases for several years, but I have no formal programming training and I am completely self-taught. I have the benefit of using several databases created by "real" programmers and I have learned a lot from them. My databases work pretty well, altho I am sure that they could be more streamlined if I knew what I was doing!

    I'm using MS Access 97 on a Windows NT 4.0 system. We are on a LAN and there are many users. I use Access 2000 at home and occasionally create a db there and convert it to 97 for use at work. I think this might be related to my problem.

    I have a simple process attached to the BeforeUpdate event on a form. It checks to see if the record has been changed and if it has, asks the user if they want to save their changes. If they say yes, the changes are saved, but I also have a little form pop up where they enter their initials and click OK. At that point, their initials are added to the record AND the "update" date is changed to the current date. This all works beautifully on a different database, and all the users of that database have no trouble.

    However, for this new database, users are getting the error message 2426 with the text as shown in the Subject Line to this posting. When they click ok on the error box, they get a run-time error that basically shows the macro that updates the date is not working. The initials are updated just fine, but the date is not updated.

    The strangest part of this is that it works JUST FINE on my workstation. For at least 2 other people, they get the error. I expect to hear from more as they start using it.

    Could this be related to having started this database on Access 2000 and converted to 97? If so, if I start a new Access 97 database and import the objects into it, would that solve the problem, or would the problem just be imported as well?

    I wondered if perhaps various users have different installations of Access, but the problem with that theory is that this exact same function works beautifully in a different database for the very users who cannot make it work in this database.

    I would very much appreciate anyone's thoughts on this strange issue.

    Thanks,
    Sandy

  6. #6
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    I agree with izyrider

    If one is not missing or broken -make sure the DAO library is checked.
    You could also work with Now() vs. Date() functions.

    <><><><><><><><><><><><><><><><><><><><><>

    Hey rami.haddad -

    How about you post an answer to the problem or maybe some of your source code instead of peddling that $50 dollar control on everyone of your posts. Obviously the user wants control of the update process to track data changes. Does your control support this???

  7. #7
    Join Date
    Jan 2004
    Posts
    184
    Hello Rockey,

    Who said it is my control? I just found that it made my life so much easier. I don't have to code anything, all I need is to bind the controls. I didn't mean to offend anybody just share something that helps. To answer your question I don't think it lets you track data changes, however I am not sure.

    http://www.geocities.com/scirocco_ha/DataControl.htm

    Originally posted by Rockey
    I agree with izyrider

    If one is not missing or broken -make sure the DAO library is checked.
    You could also work with Now() vs. Date() functions.

    <><><><><><><><><><><><><><><><><><><><><>

    Hey rami.haddad -

    How about you post an answer to the problem or maybe some of your source code instead of peddling that $50 dollar control on everyone of your posts. Obviously the user wants control of the update process to track data changes. Does your control support this???

  8. #8
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    too true Rockey.

    24 of the last 25 posts from rami.haddad are pushing this control (i didn't bother checking further back).

    now is a great time for me to check out the add to ignore list feature on this site.


    izy
    currently using SS 2008R2

  9. #9
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    You may not have offended anyone except me - I feel that this is spamming and is not appropraite. That said, this is not my board and I don't even know the rules.

    As far as this being your control - for the record, are saying it is NOT?

    Why would anyone repeat the same EXACT responce over 40 times if it was't your control.

    Hello everybody, I just wanted to share with you a control featured on download.com that I have been using that has made my life easier:

    http://www.geocities.com/scirocco_ha/DataControl.htm

    After selecting the CursorType, CursorLocation, LockType and Disconnected status of your Recordset (there are defaults). I bind my controls and that is it All the complexities of ADO are hidden from the user which is you.

    Then I can Navigate, Add New, Delete, Refresh, Search and Save Changes to my recordsets without any other code. That is really it, no other code is needed.

    This works in any environment VB, Access, VC++ etc...

    Let me know what you think.


    Does the HA in SCIROCCO_HA@yahoo.ca stands for Haddad???

  10. #10
    Join Date
    Jan 2004
    Posts
    184
    I don't just repeat the reference I try to answer the questions in the posts, however the control is useful in several occasions. In either case I will stop mentioning it as it seems to bother you and izy, again I didn't mean to offend or anger anybody.

    Originally posted by Rockey
    You may not have offended anyone except me - I feel that this is spamming and is not appropraite. That said, this is not my board and I don't even know the rules.

    As far as this being your control - for the record, are saying it is NOT?

    Why would anyone repeat the same EXACT responce over 40 times if it was't your control.



    Does the HA in SCIROCCO_HA@yahoo.ca stands for Haddad???

  11. #11
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    Just put a link to your web page in your signature. If your replys are respected, then you will get the hits to your site that you're looking for. Your control looks good and is probably well written (and worth the money). It was just the deceptive way of pushing the product that "bothered" me.

    Enough said...

    Cheers - Matt
    Last edited by Rockey; 02-21-04 at 17:23.

  12. #12
    Join Date
    Feb 2004
    Posts
    5
    izy and Matt -

    Thanks for your responses. I did try Now() instead of Date() just before leaving the office on Friday and am hoping to have good news on Monday. I'll also check for missing references. My understanding of that is weak, but I'll see what I can figure out.

    Sandy




    Originally posted by izyrider
    i'll poke my nose in since it's quiet today.

    "works fine for a given user in one application but not in another" is a classic references symptom (...though i would expect a different error message). references are local to each application (as opposed to each machine or each access installation).

    try a browse for missing references.

    izy

  13. #13
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    DAO was used by default in 97.

    Date() function is DAO.

    Open a module and click Tools-References
    Then look for anything that says Missing or the lack of "Micorsoft DAO 3.x Object Library"
    Attached Thumbnails Attached Thumbnails dao.bmp  

  14. #14
    Join Date
    Feb 2004
    Posts
    5
    Thanks to everybody - I seem to have resolved the issue. Interesting, different people had different DAO libraries, but that didn't appear to make a difference. The Now() reference didn't help. So I tried the idea of creating a new database and I simply imported everything from the original into that one, and it has solved the problem for at least one of the users who was having trouble (have not had a chance to test others yet). So it is looking up.

    Sandy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •