473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Refreshing a list box

Hi,

I have an unbound listbox in my main form that is used for reference only.
If I want to add a record to the table that this list box displays, I open a
seperate form to enter a new record to the table.

What I would like, is for the list box in the main form to refresh after the
new record is saved. Currently, I need to close and reopen the main form
that contains the listbox in order to see the new record.

Thanks

Tim
Nov 13 '05 #1
2 1563
POut the following code in the Click event of the Close button on the
'separate form':
Forms!NameOfMainForm.Requery

"Tim Graichen" <Tg*******@neo.rr.com> wrote in message
news:lt*******************@fe2.columbus.rr.com...
Hi,

I have an unbound listbox in my main form that is used for reference only.
If I want to add a record to the table that this list box displays, I open a seperate form to enter a new record to the table.

What I would like, is for the list box in the main form to refresh after the new record is saved. Currently, I need to close and reopen the main form
that contains the listbox in order to see the new record.

Thanks

Tim

Nov 13 '05 #2
Hi Tim,
The simplest way to do this is on the "Close" event of the form you use to
add/update the table used as the recordsource for the listbox put:
Private Sub Form_Close()
if isloaded("frmListBox") = True then
form_frmListBox.lboRecords.requery
endif
end sub

"IsLoaded" is a standard function that checkes to see if the form passed in
is open:
Public Function IsLoaded(ByVal strFormName as _ String) as Integer
Isloaded = Application.CurrentProject.AllForms _(strFormName).isloaded
End Function

Regards
Barry

"Tim Graichen" <Tg*******@neo.rr.com> wrote in message
news:lt*******************@fe2.columbus.rr.com...
Hi,

I have an unbound listbox in my main form that is used for reference only.
If I want to add a record to the table that this list box displays, I open a seperate form to enter a new record to the table.

What I would like, is for the list box in the main form to refresh after the new record is saved. Currently, I need to close and reopen the main form
that contains the listbox in order to see the new record.

Thanks

Tim

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: serge calderara | last post by:
Dear all, I am develpping a .NET vb application fro 2000 and XP. I have actually an Collection list of Type, where type have 4 variables inside This collection list can be really long. I then...
5
by: Scott Tilton | last post by:
I am having a terrible time getting this to work. I am hoping someone out there can help me with very specific code examples. I am trying to get the linked tables in my Access 97 database to be...
5
by: Jensen Bredal | last post by:
Hello, I need to display self refreshing information on a web page written with asp.net. I would image that the info would be displayed either as part of a user control or a web control. How can...
3
by: edamron | last post by:
I am writing my first VB.Net program and have come across an interesting problem. My department generates large volumes of documents. By law we are required to keep the documents for a specific...
1
by: Harlan Messinger | last post by:
If I have a dropdown list ddl, and the following code appears in Page_Load, then on each postback the rows previously added persist and I wind up with more and more copies of the same rows. To...
1
by: viral123 | last post by:
Hi all I have created one dropdown list box which contains all the employee name. By selecting the name from that list, it returns the details of that particular employee from the database. It...
1
by: Steve S | last post by:
Hey guys, I'm stuck with using a GridBagSizer (wxPython) in a GUI Dialog and am having a frustrating time with refreshing it properly. Essentially, I've got to refresh the contents of the...
2
by: stevemtno | last post by:
I've got a problem with a web page I'm working on. I have 4 modules - one of them has 2 tabs, two of them have 4 tabs. When the user clicks on the tabs, the content below them changes. However, when...
8
by: limperger | last post by:
Hi everyone! What about this situation? In a shared database, where people works with form, having these list boxes, imagine that 2 users enter data for the, say, same costumer, who was not in a...
5
by: handoyo | last post by:
Hi all,i'm trying to show updated data in existing html td.. For example i got column that show last modified datetime,then i want to update data again,the column will changed to current time without...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.