Solved Exporting a form as text and then importing.?

Gasman

Enthusiastic Amateur
Local time
Today, 19:16
Joined
Sep 21, 2011
Messages
16,382
In trying to help a member in this thread https://www.access-programmers.co.u...-edits-not-working.330848/page-2#post-1916720 I found that the form was likely corrupt as it was behaving strangely.
I suggested that the member recreate the form, but was wondering if they could simply export as text and then import?

However I was unable to do this.
When I exported a file it was called Form_FormName
If I tried to import that, even after changing the filename and the name of the form inside the file, it complained with

1712931314943.png


Seems strange to me that you must 'tweak' something you exported and that will not import as is? :( If it was to a different program I could understand, but when it is Access out and in?

Is this actually possible?, and if so what are the steps to do so please?
 
Did you use the SaveAsText method to export the form?
 
When I exported a file it was called Form_FormName
If I tried to import that, even after changing the filename and the name of the form inside the file, it complained with
Did you delete the existing form before importing from text?
 
You exported from vb window must save and import as text .
 
You exported from vb window must save and import as text .
Exactly where MajP please?
If I remove Form_ from both filename and inside, it will import in VBA window, but as a class module at the bottom, not a form class.
 
Can we dial back a second @Gasman - how did you do the Save/Load as/from text?

Like:
Code:
Application.SaveAsText acForm, "frmName", "C:\path\to\file.txt"

' and

Application.LoadFromText acForm, "frmName", "C:\path\to\file.txt"

?
 
Can we dial back a second @Gasman - how did you do the Save/Load as/from text?

Like:
Code:
Application.SaveAsText acForm, "frmName", "C:\path\to\file.txt"

' and

Application.LoadFromText acForm, "frmName", "C:\path\to\file.txt"

?
I did not.
I used from the VBA window interactively .....
Export File and accepted the default .cls extension
Then tried an Import File after renaming both filename and the form name inside the file.

So it has to be done via VBA?
 
Did you use the code I posted in the other thread?

Please post the the code YOU used to export and then to import.
 
Did you use the code I posted in the other thread?

Please post the the code YOU used to export and then to import.
Are you referring to the post I mentioned in post #1 Pat, or some other thread?
 
Can we dial back a second @Gasman - how did you do the Save/Load as/from text?

Like:
Code:
Application.SaveAsText acForm, "frmName", "C:\path\to\file.txt"

' and

Application.LoadFromText acForm, "frmName", "C:\path\to\file.txt"

?
That did the trick. Thank you.

I was going about it the completely wrong way. :(
 
That did the trick. Thank you.

I was going about it the completely wrong way. :(
That's what I was trying to clarify in my first post. Glad to hear you got it sorted out.

It's somewhat weird though. This is the second thread this morning where my posts were missed/ignored. I wonder what I am doing wrong?
 
That's what I was trying to clarify in my first post. Glad to hear you got it sorted out.

It's somewhat weird though. This is the second thread this morning where my posts were missed/ignored. I wonder what I am doing wrong?
Not intended I assure you @theDBguy :)

Just completely missed it.
My apologies.
 

Users who are viewing this thread

Back
Top Bottom