Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

added record to listbox

Posted on 2006-04-25
4
Medium Priority
?
180 Views
Last Modified: 2010-05-01
hello,
I have a listbox and a add button,
the add button will add a record to a ini file
email@domain.com;pass;
its working, but when im at add.frm adding
and click save I go to main.frm and is not
showing it, unless I reopen the program
why is that?
0
Comment
Question by:aplelois
  • 2
4 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 16542835
you need to read the ini file again and display on your listbox
0
 
LVL 6

Accepted Solution

by:
junglerover77 earned 2000 total points
ID: 16542853
Your "Add" button of "add.frm" just adds a record to your INI file. So, it's obvious that your "main.frm" will not show the newly added record unless you reload it from your INI file.

Just add the following code to your "main.frm":
public sub ReloadINI()
    call form_load
end sub

Then, add the following code to the event handler of the "Save" button of your "add.frm":
public sub cmdSave_Click()
    'save operation.......

    call main.ReloadINI
end sub
0
 

Author Comment

by:aplelois
ID: 16543064
ok it worked but when I added two more
its showing

email1
email2
email3
then it reapeat it
email1
email2
email3
email4
again
email1
email2
email3
email4
email5
0
 
LVL 6

Expert Comment

by:junglerover77
ID: 16543107
Add one more statement in ReloadINI of main.frm (if your listbox is names List1):

public sub ReloadINI()
    List1.Clear
    call form_load
end sub
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 15 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question