Is there any way to save the user input so that next time a user runs the app
it pops up with the information they entered last time in all the fields???

Thanks,
Axe

Re: Saving & Restoring Form Information by Jean-Guy

Jean-Guy
Thu May 26 17:03:58 CDT 2005

axeman was telling us:
axeman nous racontait que :

> Is there any way to save the user input so that next time a user runs
> the app it pops up with the information they entered last time in all
> the fields???

???
More details are needed. What app are you talking about? What kind of
fields? What is the context? Word version?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org




Re: Saving & Restoring Form Information by Dawn

Dawn
Thu May 26 17:11:07 CDT 2005

I would store the information in Document Variables if you want the
data available for repeat running.

Here is some sample code which will check to see whether a variable
exists, if not it will help you to create one, and add a value to it.

'Test to see whether document variables exist if not add then

If DocVarExists("varClientName") Then

ActiveDocument.Variables("varClientName").Value = "test"

Else

ActiveDocument.Variables.Add Name:="varClientName",
Value:="test"

End If



'Function used to check to make sure the Document Variable exists
because

'If you try to add it, and it does not exist - an error will be
returned.

'Same is true if you try to set its value and it does not exist.

Function DocVarExists(strVarName As String) As Boolean

Dim varDocVars As Variant



DocVarExists = False

For Each varDocVars In ActiveDocument.Variables

If varDocVars.Name = strVarName Then DocVarExists = True

Next varDocVars



End Function



To retrieve a Document Variable for use

= ActiveDocument.Variables("varVersion").Value



To update a Bookmark based on a result from code

ActiveDocument.Bookmarks("DateOfLetter").Range = _

ActiveDocument.Variables("varVersion").Value



I hope this helps.


--
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message is posted to a newsgroup. Please post replies and
questions to the newsgroup so that others can learn as well.

"axeman" <axeman@discussions.microsoft.com> wrote in message
news:D2AA7C50-0092-44E9-89BD-2FFEECA23C85@microsoft.com...
> Is there any way to save the user input so that next time a user
> runs the app
> it pops up with the information they entered last time in all the
> fields???
>
> Thanks,
> Axe


Re: Saving & Restoring Form Information by Jean-Guy

Jean-Guy
Fri May 27 09:48:12 CDT 2005

Dawn Crosier was telling us:
Dawn Crosier nous racontait que :

> I would store the information in Document Variables if you want the
> data available for repeat running.
>
> Here is some sample code which will check to see whether a variable
> exists, if not it will help you to create one, and add a value to it.

Just thought I'd mention to those interested with "short" code that you do
not need to check for existence if you want to create a document variable:

ActiveDocument.Variables("varClientName").Value = "test"

will create it if it does not exist, and

ActiveDocument.Variables("varClientName").Value = ""

will effectively delete the variable.

You still have to check if it exists if you want to read the variable
though.

ActiveDocument.Variables("varClientName").Value = ""
MsgBox ActiveDocument.Variables("varClientName").Value

will generate an error.

> 'Test to see whether document variables exist if not add then
>
> If DocVarExists("varClientName") Then
>
> ActiveDocument.Variables("varClientName").Value = "test"
>
> Else
>
> ActiveDocument.Variables.Add Name:="varClientName",
> Value:="test"
>
> End If
>
>
>
> 'Function used to check to make sure the Document Variable exists
> because
>
> 'If you try to add it, and it does not exist - an error will be
> returned.
>
> 'Same is true if you try to set its value and it does not exist.
>
> Function DocVarExists(strVarName As String) As Boolean
>
> Dim varDocVars As Variant
>
>
>
> DocVarExists = False
>
> For Each varDocVars In ActiveDocument.Variables
>
> If varDocVars.Name = strVarName Then DocVarExists = True
>
> Next varDocVars
>
>
>
> End Function
>
>
>
> To retrieve a Document Variable for use
>
> = ActiveDocument.Variables("varVersion").Value
>
>
>
> To update a Bookmark based on a result from code
>
> ActiveDocument.Bookmarks("DateOfLetter").Range = _
>
> ActiveDocument.Variables("varVersion").Value
>
>
>
> I hope this helps.
>
>
> --
> Dawn Crosier
> Microsoft MVP
> "Education Lasts a Lifetime"
>
> This message is posted to a newsgroup. Please post replies and
> questions to the newsgroup so that others can learn as well.
>
> "axeman" <axeman@discussions.microsoft.com> wrote in message
> news:D2AA7C50-0092-44E9-89BD-2FFEECA23C85@microsoft.com...
>> Is there any way to save the user input so that next time a user
>> runs the app
>> it pops up with the information they entered last time in all the
>> fields???
>>
>> Thanks,
>> Axe

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org




Re: Saving & Restoring Form Information by axeman

axeman
Tue May 31 17:59:49 CDT 2005

How would this work for a userform that I want to restores the values of the
fields every time that the application is run. Basically, the user inputs the
information and closes out of the application once they are finished with
their processing. Then the next time that they run the app the information
they typed in last is automcatically populated in all the fields.

Thanks,
Axe

"Dawn Crosier" wrote:

> I would store the information in Document Variables if you want the
> data available for repeat running.
>
> Here is some sample code which will check to see whether a variable
> exists, if not it will help you to create one, and add a value to it.
>
> 'Test to see whether document variables exist if not add then
>
> If DocVarExists("varClientName") Then
>
> ActiveDocument.Variables("varClientName").Value = "test"
>
> Else
>
> ActiveDocument.Variables.Add Name:="varClientName",
> Value:="test"
>
> End If
>
>
>
> 'Function used to check to make sure the Document Variable exists
> because
>
> 'If you try to add it, and it does not exist - an error will be
> returned.
>
> 'Same is true if you try to set its value and it does not exist.
>
> Function DocVarExists(strVarName As String) As Boolean
>
> Dim varDocVars As Variant
>
>
>
> DocVarExists = False
>
> For Each varDocVars In ActiveDocument.Variables
>
> If varDocVars.Name = strVarName Then DocVarExists = True
>
> Next varDocVars
>
>
>
> End Function
>
>
>
> To retrieve a Document Variable for use
>
> = ActiveDocument.Variables("varVersion").Value
>
>
>
> To update a Bookmark based on a result from code
>
> ActiveDocument.Bookmarks("DateOfLetter").Range = _
>
> ActiveDocument.Variables("varVersion").Value
>
>
>
> I hope this helps.
>
>
> --
> Dawn Crosier
> Microsoft MVP
> "Education Lasts a Lifetime"
>
> This message is posted to a newsgroup. Please post replies and
> questions to the newsgroup so that others can learn as well.
>
> "axeman" <axeman@discussions.microsoft.com> wrote in message
> news:D2AA7C50-0092-44E9-89BD-2FFEECA23C85@microsoft.com...
> > Is there any way to save the user input so that next time a user
> > runs the app
> > it pops up with the information they entered last time in all the
> > fields???
> >
> > Thanks,
> > Axe
>
>

Re: Saving & Restoring Form Information by Charles

Charles
Tue May 31 18:09:54 CDT 2005

Store the information in your document/template as document variables and
save. When userform is used again, have it check for existence of variables
and if present, use those values.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"axeman" <axeman@discussions.microsoft.com> wrote in message
news:19DE1299-50C4-45C2-BA9C-A217514854CB@microsoft.com...
> How would this work for a userform that I want to restores the values of
> the
> fields every time that the application is run. Basically, the user inputs
> the
> information and closes out of the application once they are finished with
> their processing. Then the next time that they run the app the information
> they typed in last is automcatically populated in all the fields.
>
> Thanks,
> Axe
>
> "Dawn Crosier" wrote:
>
>> I would store the information in Document Variables if you want the
>> data available for repeat running.
>>
>> Here is some sample code which will check to see whether a variable
>> exists, if not it will help you to create one, and add a value to it.
>>
>> 'Test to see whether document variables exist if not add then
>>
>> If DocVarExists("varClientName") Then
>>
>> ActiveDocument.Variables("varClientName").Value = "test"
>>
>> Else
>>
>> ActiveDocument.Variables.Add Name:="varClientName",
>> Value:="test"
>>
>> End If
>>
>>
>>
>> 'Function used to check to make sure the Document Variable exists
>> because
>>
>> 'If you try to add it, and it does not exist - an error will be
>> returned.
>>
>> 'Same is true if you try to set its value and it does not exist.
>>
>> Function DocVarExists(strVarName As String) As Boolean
>>
>> Dim varDocVars As Variant
>>
>>
>>
>> DocVarExists = False
>>
>> For Each varDocVars In ActiveDocument.Variables
>>
>> If varDocVars.Name = strVarName Then DocVarExists = True
>>
>> Next varDocVars
>>
>>
>>
>> End Function
>>
>>
>>
>> To retrieve a Document Variable for use
>>
>> = ActiveDocument.Variables("varVersion").Value
>>
>>
>>
>> To update a Bookmark based on a result from code
>>
>> ActiveDocument.Bookmarks("DateOfLetter").Range = _
>>
>> ActiveDocument.Variables("varVersion").Value
>>
>>
>>
>> I hope this helps.
>>
>>
>> --
>> Dawn Crosier
>> Microsoft MVP
>> "Education Lasts a Lifetime"
>>
>> This message is posted to a newsgroup. Please post replies and
>> questions to the newsgroup so that others can learn as well.
>>
>> "axeman" <axeman@discussions.microsoft.com> wrote in message
>> news:D2AA7C50-0092-44E9-89BD-2FFEECA23C85@microsoft.com...
>> > Is there any way to save the user input so that next time a user
>> > runs the app
>> > it pops up with the information they entered last time in all the
>> > fields???
>> >
>> > Thanks,
>> > Axe
>>
>>



Re: Saving & Restoring Form Information by sc

sc
Thu Aug 04 18:03:03 CDT 2005

I need help with naming and declaring a variable to store string data in
textboxes, then saving that data, so that when the program is opened at a
later time, the data is still there. I don't understand what you have said so
far about checking for the existence of variables. Why can't a person just
name and declare a variable for the data, then save it? I have 6 forms. On
Form1, there are 5 textboxes. I want to save the user input to these
textboxes, so it is there when the program is reopened later. How can I do
that?



--
sc


"Dawn Crosier" wrote:

> I would store the information in Document Variables if you want the
> data available for repeat running.
>
> Here is some sample code which will check to see whether a variable
> exists, if not it will help you to create one, and add a value to it.
>
> 'Test to see whether document variables exist if not add then
>
> If DocVarExists("varClientName") Then
>
> ActiveDocument.Variables("varClientName").Value = "test"
>
> Else
>
> ActiveDocument.Variables.Add Name:="varClientName",
> Value:="test"
>
> End If
>
>
>
> 'Function used to check to make sure the Document Variable exists
> because
>
> 'If you try to add it, and it does not exist - an error will be
> returned.
>
> 'Same is true if you try to set its value and it does not exist.
>
> Function DocVarExists(strVarName As String) As Boolean
>
> Dim varDocVars As Variant
>
>
>
> DocVarExists = False
>
> For Each varDocVars In ActiveDocument.Variables
>
> If varDocVars.Name = strVarName Then DocVarExists = True
>
> Next varDocVars
>
>
>
> End Function
>
>
>
> To retrieve a Document Variable for use
>
> = ActiveDocument.Variables("varVersion").Value
>
>
>
> To update a Bookmark based on a result from code
>
> ActiveDocument.Bookmarks("DateOfLetter").Range = _
>
> ActiveDocument.Variables("varVersion").Value
>
>
>
> I hope this helps.
>
>
> --
> Dawn Crosier
> Microsoft MVP
> "Education Lasts a Lifetime"
>
> This message is posted to a newsgroup. Please post replies and
> questions to the newsgroup so that others can learn as well.
>
> "axeman" <axeman@discussions.microsoft.com> wrote in message
> news:D2AA7C50-0092-44E9-89BD-2FFEECA23C85@microsoft.com...
> > Is there any way to save the user input so that next time a user
> > runs the app
> > it pops up with the information they entered last time in all the
> > fields???
> >
> > Thanks,
> > Axe
>
>