none
Can't loadfromtext anymore RRS feed

  • Question

  • Hi,

    I can save my forms with Application.saveastext acForm, form, path with no Problem, but a reimport in the same Database with:

    Application.loadfromtext acForm, form, path doesn't work anymore. I always get the 2128-Runtime-Error.

    Other objects like Module etc. work without any problem.

    I tried it with Access 2015 and 2016.

    Can someone try it?

    Thx

    fiveyears

    Tuesday, March 15, 2016 9:51 AM

Answers

  • Hi,

    I can save my forms with Application.saveastext acForm, form, path with no Problem, but a reimport in the same Database with:

    Application.loadfromtext acForm, form, path doesn't work anymore. I always get the 2128-Runtime-Error.

    Other objects like Module etc. work without any problem.

    I tried it with Access 2015 and 2016.

    Can someone try it?

    Thx

    fiveyears

    I interpreted your question as, "can someone try" or verify you can still LoadFromText in Access 2016 as you were having trouble with that. I verified it still works. I don't see another question there.

    Never the less I'm glad you have it solved.


    Just takes a click to give thanks for a helpful post or answer.
    Please vote “Helpful” or Mark as “Answer” as appropriate.
    Chris Ward
    Microsoft Community Contributor 2012

    • Marked as answer by fiveyears Tuesday, March 15, 2016 5:57 PM
    Tuesday, March 15, 2016 4:50 PM

All replies

  • Bills Method still works...

    SaveAsText/LoadFromText

    The arguments for
    Application.SaveAsText() are:


    1. the object type
    2. the object name
    3. the file path and name to save
      as

    So if I had a form named frmCustomers
    I could save it to my folder Databases on my C: drive in the Databases folder
    like this:

    Application.SaveAsText
    acForm,"frmCustomers","C:\Databases\frmCustomers"

    To load it into any database, all you
    need to do is open the database and use the LoadFromText method like
    this:

    Application.LoadFromText
    acForm,"frmCustomers","C:\Databases\frmCustomers"

    Note the parameters are the same,
    except this time the file is the existing file.


    Just takes a click to give thanks for a helpful post or answer.
    Please vote “Helpful” or Mark as “Answer” as appropriate.
    Chris Ward
    Microsoft Community Contributor 2012



    • Edited by KCDW Tuesday, March 15, 2016 1:23 PM
    Tuesday, March 15, 2016 1:22 PM
  • This is not the answer of my question.

    I get the runtime-error 2128 while doing:

    Application.LoadFromText 
    acForm,"frmCustomers","C:\Databases\frmCustomers"

    and I don't know why!

    Tuesday, March 15, 2016 2:05 PM
  • I have found it.

    The database type was *.mdb.

    SaveAsText Wrote a line: NoSaveCTIWhenDisabled=1

    This line prevents the reimport of my forms. After deleting the line in the text file the loadfromtext worked.

    My workaround is to save my database as *.accdb, then the reimport of my forms works with the line

    NoSaveCTIWhenDisabled=1

    Grüße

    fiveyears

    Tuesday, March 15, 2016 2:54 PM
  • Hi,

    I can save my forms with Application.saveastext acForm, form, path with no Problem, but a reimport in the same Database with:

    Application.loadfromtext acForm, form, path doesn't work anymore. I always get the 2128-Runtime-Error.

    Other objects like Module etc. work without any problem.

    I tried it with Access 2015 and 2016.

    Can someone try it?

    Thx

    fiveyears

    I interpreted your question as, "can someone try" or verify you can still LoadFromText in Access 2016 as you were having trouble with that. I verified it still works. I don't see another question there.

    Never the less I'm glad you have it solved.


    Just takes a click to give thanks for a helpful post or answer.
    Please vote “Helpful” or Mark as “Answer” as appropriate.
    Chris Ward
    Microsoft Community Contributor 2012

    • Marked as answer by fiveyears Tuesday, March 15, 2016 5:57 PM
    Tuesday, March 15, 2016 4:50 PM