Newbie Question!! 
Author Message
 Newbie Question!!

Hello,

I already made a form that has two input boxes. The values that are
typed in, are saved in  the windows registry.  what I want to do now is
to take those values and put them in a Testbox, So that when the user
opens that form, the values they typed in the previous time are in the
text boxes. I already got the saving thing down.  Below is the code that
I used to save text in the input boxes:

-----------------------------------------------------------------
Private Sub Save_Click()
    SaveSetting "My_Prog", "FirstName", "FirstName", Text1.Text
    SaveSetting "My_Prog", "LastName", "LastName", Text2.Text
    Unload Me
End Sub
-----------------------------------------------------------------

Here is what I tried already:
-----------------------------------------------------------------
Private Sub Form1_Load()
    Text1.Text=GetSetting "My_Prog", "FirstName", "FirstName"
    Text2.Text=GetSetting "My_Prog", "LastName", "LastName"
End Sub
-----------------------------------------------------------------

If anyone Could Help, I would really appreciate it.

Thanks,
Mike Vollmer



Wed, 15 Dec 1999 03:00:00 GMT  
 Newbie Question!!

Parenthesis are required on GetSetting as it's a function.  SaveSetting =
is a statement. However, he is passing the keyname for both the key and =
item (or the item name for the item and key).  Maybe:

 Private Sub Save_Click()
     SaveSetting "My_Prog", "UserInput", "FirstName", (Text1)
     SaveSetting "My_Prog", "UserInput", "LastName", (Text2)
     Unload Me
 End Sub

 Private Sub Form1_Load()
     Text1 =3D GetSetting("My_Prog", "UserInput", "FirstName")
     Text2 =3D GetSetting("My_Prog", "UserInput", "LastName")
 End Sub

--=20
Randy Birch, MVP Visual Basic

Moderator, Fidonet Visual Basic Programmer's Conference
VBnet, The Visual Basic Developers Resource Centre
http://home.sprynet.com/sprynet/rasanen/



: Is it that your missing the parenthesis and maybe default values?
:=20
: ' get screen center for default values
: lft =3D (Screen.Width - Me.Width) / 2
: tup =3D (Screen.Height - Me.Height) / 2
:=20
: ' read registry  appname ,  folder,  key , default values
: Me.Top =3D GetSetting("WebRefs", "Startup", "Top", tup)
: Me.Left =3D GetSetting("WebRefs", "Startup", "Left", lft)
:=20
: --=20
: Hope this helps,
: Ed Wilk=20
: http://www.geocities.com/ResearchTriangle/6760/index.html
: Home of Edgemeal Software (FreeWare)
:=20
:=20
:=20


: > Hello,
: >=20
: > I already made a form that has two input boxes. The values that are
: > typed in, are saved in  the windows registry.  what I want to do now =
is
: > to take those values and put them in a Testbox, So that when the =
user
: > opens that form, the values they typed in the previous time are in =
the
: > text boxes. I already got the saving thing down.  Below is the code =
that
: > I used to save text in the input boxes:
: >=20
: > -----------------------------------------------------------------
: > Private Sub Save_Click()
: >     SaveSetting "My_Prog", "FirstName", "FirstName", Text1.Text
: >     SaveSetting "My_Prog", "LastName", "LastName", Text2.Text
: >     Unload Me
: > End Sub
: > -----------------------------------------------------------------
: >=20
: > Here is what I tried already:
: > -----------------------------------------------------------------
: > Private Sub Form1_Load()
: >     Text1.Text=3DGetSetting "My_Prog", "FirstName", "FirstName"
: >     Text2.Text=3DGetSetting "My_Prog", "LastName", "LastName"
: > End Sub
: > -----------------------------------------------------------------
: >=20
: >=20
: > If anyone Could Help, I would really appreciate it.
: >=20
: > Thanks,
: > Mike Vollmer

: >=20
: >=20
:=20
:



Fri, 17 Dec 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Newbie question: Session_OnEnd question

2. Resizing forms question (newbie question)

3. Access97 VBA newbie question

4. Newbie Question: Understanding Syntax

5. Newbie question:

6. Newbie Questions About DAO Queries to SQL Server

7. Brand newbie questions

8. Newbie question

9. Newbie question: open file

10. vba Newbie Question

11. Newbie Question: Getting the Values from Calculated controls into a table

12. Newbie question for calling functions

 

 
Powered by phpBB® Forum Software