Results 1 to 5 of 5

Thread: Okay, How'bout this....

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    67
    Say I have 2 diff't forms.
    On frm1, There are 3 txt boxes (txt1,txt2,txt3)
    1 cmd button (cmd1)
    -the purpose of this form is to add txt1 + txt2, to get the result in txt3

    On frm2 there is one txt box (txtA)
    and one cmd button (cmdA)

    The purpose of all this is for a user to input a number in txt1, have it added to what's already in txt2 to get txt3.

    Txt2 should get it's info from whatever is set on frm2 txtA.

    Frm2 txtA's number should always stay the same until a user goes in to change it. It should also remain after the user shuts down the program and restarts it again. Think of it as a "settings" form.

    How exactly do I pull this off?
    (I'm sorry if I made this more confusing than it had to be)
    Thank You.

  2. #2
    Lively Member
    Join Date
    Oct 2000
    Location
    Scotland
    Posts
    96

    Smile A few things to try

    try...

    txt2 = frm2.txtA

    this will work if form 2 is not closed (it'll work if form 2 is hidden)

    or you could try storing the value in txtA to a integer variable and using the variable. This variable will have ot be stored in a module (just add on from the menu )

    'In module
    Global temp as integer
    ...

    'In form 2
    temp = txtA

    'In form 1
    txt2 = temp


    so that temp is updated every time the value of txtA is changed you could put in a txtA_data_changed fn.

    Hope it helps.

    H.
    Just trying to muddle through...

  3. #3
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    Use savesetting and getsetting to save your data to the registry

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    67
    Hollie, thank you.

    Mart, could you explain a little more? (I'm new)
    Thank you

  5. #5
    Lively Member
    Join Date
    Nov 2000
    Posts
    82
    Marnitzg has the right idea. There's plenty of documentation for these commands in both the VB Help files and anywhere on the web (including this site; use the Search feature). These two commands will store a value in the user's Registry that can be altered and recovered at will. Here's the basics:

    Code:
    ' Place some settings in the registry.
    SaveSetting "MyApp","Startup", "Left", 50 
    
    'This will return the correct value (50)
    iLeftSetting = GetSetting("MyApp", "Startup", "Left")
    If this app will be running as a multi-user app with a central set of values for all users, you might think about creating an ini file to hold those values (again, do a Search here).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width