Results 1 to 9 of 9
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    File db will not save the way it was intended

    In the attached db file that I am using, there is a typo in this in the form frmEmail VBA's code.

    stWhere = "qry Personnel Meeting Query.email address" = " & " '" & stWho & "'"

    I rewrite it as this

    stWhere = "qry Personnel Meeting Query.email address" = " & "'" & stWho & "'"

    I changed the space to the right of the first ampersand from " '" to "'" . This allows the line to make sense.



    Now when I saved the whole db it switches the line back to

    stWhere = "qry Personnel Meeting Query.email address" = " & " '" & stWho & "'"

    which as I said is wrong.

    Why is it not saving the line the way that I want it to? I had a similar problem on a variable name a few days ago
    and it had to do with how I declared it at the top of the SUB declaration area. Is this also causing this?

    The file with this issue is attached.

    Any help appreciated. hanks in advance.

    Respectfully,

    Lou Reed
    Attached Files Attached Files

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Tried telling you in previous posts all those variables that are not needed would be a pain down the road to always have to deal with instead of just using the actual fields, etc.

    What is this statement anyway, is that first part "qry Personnel Meeting Query.email address"a reference to a field? The source is qry Personnel Meeting Query really has all those spaces?

    Also last part does not seem right if that is a string, maybe
    "qryPersonnelMeeting.emailAddr3ess = '" & strWho & "'"

  3. #3
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    Correct syntax is: stWhere = "[qry Personnel Meeting Query].[email address] = '" & stWho & "'"

    And in one of your previous databases, the query is actually named "
    qryPersonnel Meeting Query"

    The brackets are necessary whenever you have spaces in your object names.


  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    well, the code is commented out (you can tell because it is green), so all the vba editor is doing is putting the space before the single quote as standard functionality. You need to look further back in the line and remove the surplus double quotation (after 'address'). Then removing your surplus space will work

  5. #5
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I have changed as much as I dare for now all variables with spaces in their names. But to prevent a complete hash of the project, I have left some the names the way they are. The object is to get the bugs out of the system first, then rename variables to name without spaces.

    As I said in my post I had a similar problem with correcting a error - saving the db - running the db - error resurfaces - check the source code and errors is back in the code. It is almost as if I never changed the code in the first place and 2 or 3 cycles of this and you begin to think you must be doing something wrong.

    I just had lunch with a seasoned MS Access programmer and told him of my issues and he nodded his head like he had heard it all before. So I guess this is what is to be expected.

    I am trying to get this done.

    I will change all variable to the space less analogues, when I am convinced most errors are out of the VBA code.

    It is not a good idea to take a two tract approach since I am so new in this area.

    I appreciate your help and I will try to solutions you said.

    Thanks for everything.


    Respectfully,


    Lou Reed

  6. #6
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Code:
    What is this statement anyway, is that first part "qry Personnel Meeting Query.email address"a reference to a field?  The source is qry Personnel Meeting Query really has all those spaces?
    This has been changed to qryPersonnelMeeting.emailaddress. I think that is what you want. I am leaving out brackets on these variables names, because these variables have been renamed to their space less analogues.

    I am just not sure why I was getting a blank page when I opened the form to send email from the form frmPersonnel.

    I thought it would be easier to take a 3 day old db that worked and make needed corrections to it. It seemed it would be quicker.

    Maybe it was not.

    Respectfully,

    Lou Reed

  7. #7
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    Usually it is better to stick with the latest version of your database. Bouncing between versions is surely confusing you, and us.

  8. #8
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    The error is hard to correct

    I agree with that, but when you hit a situation that seems to have no answer (as I did this morning) then I decided to go back to one db that works and is 1-2 days old. Then to start putting in the changes and see where the error occurs. I will test the db after each change which should tell me (when I find a version of the db that fails) that what I did last is what is causing the error.

    I tried this and I still got to a point where the db fails. Open the form frmPersonnel, then click on button to send email. The form frmEmail opens and it is blank. Why?

    What is causing this? I am back to where I was a few hours ago.

    The frmEmail opens up quite quickly and easily when I directly click on it in the navigation pane. It just has a problem when I open it up via the form frmPersonnel. That is when frmEmail opens up blank.

    Again what is causing this. The db zipped file is attached.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed
    Attached Files Attached Files

  9. #9
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I think that I know what is causing the screen to be blank. When I open frmEmail from form frmPersonnel. I went back and changed in tblPersonnel the field emailaddress to email address and when I performed the sequence of steps I described in the first sentence, I open frmEmail from frmPersonnel and there was no blank screen. It was all filled. So there I think is the problem.


    use

    emailaddress get no blank frmEmail screen when open from frmPerrsonnel;

    use email address and you will get the blank screen when you do the same thing.

    Why is this happening?

    Respectfully,

    Lou Reed

Please reply to this thread with any new information or opinions.

Similar Threads

  1. vba to save a file to icloud
    By Gina Maylone in forum Programming
    Replies: 3
    Last Post: 12-06-2015, 10:02 AM
  2. save report as pdf file
    By linoreale in forum Reports
    Replies: 5
    Last Post: 01-31-2015, 10:47 AM
  3. Replies: 12
    Last Post: 07-13-2012, 02:00 PM
  4. Save imagebox to file?
    By EmSox in forum Forms
    Replies: 0
    Last Post: 07-28-2010, 10:32 AM
  5. form not displaying as intended
    By markjkubicki in forum Forms
    Replies: 1
    Last Post: 07-24-2010, 07:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums