472,954 Members | 1,448 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Update a Listbox after making a change in a field

Hello... thank you for your time.

I have a form that has a List box of equipotent records and a sub form
that will show the data of the equipment select from the list box.

Is it possible to make a change in the name field in the details, then
refresh the list box with new name?

Please help and thanks!

N. Graves
Nov 12 '05 #1
4 26007
N. Graves wrote:
Hello... thank you for your time.

I have a form that has a List box of equipotent records and a sub form
that will show the data of the equipment select from the list box.

Is it possible to make a change in the name field in the details, then
refresh the list box with new name?

Please help and thanks!

N. Graves


If refreshing in the main form, and the listbox is called LB1, then
Me.LB1.Requery
If the LB is in a main form but called to refresh from a subform
Forms!MainForm!LB1.Requery

Nov 12 '05 #2
Thanks you so much for your input. I think I need to add a little
more to my disruptions. First here is the code that I'm using

Private Sub CommonName_AfterUpdate()
Forms!frm_AddEdit_Equipment_Master.lst_EquipID.Req uery
End Sub

Action: When I update this field and move to another field the screen
will flicker like it is refreshing but nothing happens... If I go
back to the field and change it again and leave then the list box will
update but it displays the first change and not the last change.

I'm guessing that I need to update the record (save the record) before
I update the list box. I have search help but not able to find the
command to post the changes to the table before I refresh.

Can you help me?

Thanks again!

N. Graves

On Thu, 20 May 2004 21:02:27 GMT, Salad <oi*@vinegar.com> wrote:
N. Graves wrote:
Hello... thank you for your time.

I have a form that has a List box of equipotent records and a sub form
that will show the data of the equipment select from the list box.

Is it possible to make a change in the name field in the details, then
refresh the list box with new name?

Please help and thanks!

N. Graves


If refreshing in the main form, and the listbox is called LB1, then
Me.LB1.Requery
If the LB is in a main form but called to refresh from a subform
Forms!MainForm!LB1.Requery


Nov 12 '05 #3
N. Graves wrote:
Thanks you so much for your input. I think I need to add a little
more to my disruptions. First here is the code that I'm using

Private Sub CommonName_AfterUpdate()
Forms!frm_AddEdit_Equipment_Master.lst_EquipID.Req uery
End Sub
Action: When I update this field and move to another field the screen
will flicker like it is refreshing but nothing happens... If I go
back to the field and change it again and leave then the list box will
update but it displays the first change and not the last change.
I'm guessing that I need to update the record (save the record) before
I update the list box. I have search help but not able to find the
command to post the changes to the table before I refresh.
That would appear to be correct if the listbox's rowsource are records
in a table and not a value list or user defined list. If you haven't
committed the changes (saved record) and the rowsource is from a table,
it certainly is not going to have that in the listbox.

You could enter a command like
Me.Dirty = False
to save the record just prior to requerying. Another option is to put
the Requery in the AfterUpdate event of the form...IOW, after the record
has been saved. I don't know why it needs to be in the listbox
immediately after a field is changed.

If you absolutely, positively need to have this when the field changes
and not when the record changes you have a couple of options....make the
rowsource a value list and concatenate the data to display. There is a
caveat using this method...I think the string length for a value list is
2048 so you can't display too many rows. Or, write a UserDefine
function. If you are willing to futz with that (maybe do some searches
at Google groups, *Access*, for userdefine callbacks, you should get
plenty of code to assist.


Can you help me?

Thanks again!

N. Graves

On Thu, 20 May 2004 21:02:27 GMT, Salad <oi*@vinegar.com> wrote:

N. Graves wrote:

Hello... thank you for your time.

I have a form that has a List box of equipotent records and a sub form
that will show the data of the equipment select from the list box.

Is it possible to make a change in the name field in the details, then
refresh the list box with new name?

Please help and thanks!

N. Graves


If refreshing in the main form, and the listbox is called LB1, then
Me.LB1.Requery
If the LB is in a main form but called to refresh from a subform
Forms!MainForm!LB1.Requery



Nov 12 '05 #4
Thank you for your insight!

That worked with the Dirty = False.

I have posted another question title "Tab Control Display issue" If
you have an extra moment to take a look and response. I'll owe you a
one

Thanks

N. Graves

On Fri, 21 May 2004 17:27:50 GMT, Salad <oi*@vinegar.com> wrote:
N. Graves wrote:
Thanks you so much for your input. I think I need to add a little
more to my disruptions. First here is the code that I'm using

Private Sub CommonName_AfterUpdate()
Forms!frm_AddEdit_Equipment_Master.lst_EquipID.Req uery
End Sub


Action: When I update this field and move to another field the screen
will flicker like it is refreshing but nothing happens... If I go
back to the field and change it again and leave then the list box will
update but it displays the first change and not the last change.


I'm guessing that I need to update the record (save the record) before
I update the list box. I have search help but not able to find the
command to post the changes to the table before I refresh.


That would appear to be correct if the listbox's rowsource are records
in a table and not a value list or user defined list. If you haven't
committed the changes (saved record) and the rowsource is from a table,
it certainly is not going to have that in the listbox.

You could enter a command like
Me.Dirty = False
to save the record just prior to requerying. Another option is to put
the Requery in the AfterUpdate event of the form...IOW, after the record
has been saved. I don't know why it needs to be in the listbox
immediately after a field is changed.

If you absolutely, positively need to have this when the field changes
and not when the record changes you have a couple of options....make the
rowsource a value list and concatenate the data to display. There is a
caveat using this method...I think the string length for a value list is
2048 so you can't display too many rows. Or, write a UserDefine
function. If you are willing to futz with that (maybe do some searches
at Google groups, *Access*, for userdefine callbacks, you should get
plenty of code to assist.


Can you help me?

Thanks again!

N. Graves

On Thu, 20 May 2004 21:02:27 GMT, Salad <oi*@vinegar.com> wrote:

N. Graves wrote:
Hello... thank you for your time.

I have a form that has a List box of equipotent records and a sub form
that will show the data of the equipment select from the list box.

Is it possible to make a change in the name field in the details, then
refresh the list box with new name?

Please help and thanks!

N. Graves

If refreshing in the main form, and the listbox is called LB1, then
Me.LB1.Requery
If the LB is in a main form but called to refresh from a subform
Forms!MainForm!LB1.Requery



Nov 13 '05 #5

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

Similar topics

3
by: Colleyville Alan | last post by:
I have a incremental search box that has been working fine for a couple of months but is now acting up. This search box is from the cd that comes with Getz's book, so I did not write it and have...
2
by: Geir Baardsen | last post by:
Hi! From a listbox I'd like to send only selected items to a report. Items will include: OrderNr,Date,EmployeeNr from tblOrders ZipCode,City from tblZipCodes Name,Adr,ZipID from...
8
by: tshad | last post by:
I have a string that I read from my database: 1|8|5620|541 These are all values in my ListBox. I want to select each of these items (4 of them - but could be many more). At the moment I am...
3
by: Brian | last post by:
I have a form that has a textbox used to search records in a table. On the form I have a listbox which shows each record in the table. When you click on each row in the listbox the rest of the form...
5
by: Marc Gravell | last post by:
In the following example, the Bindings don't update the UI if the property change is triggered from the non-UI thread - see the async button - from the listbox contents (and observation) the change...
2
by: Miro | last post by:
I will ask the question first then fumble thru trying to explain myself so i dont waste too much of your time. Question / Statement - Every mdb table needs a PrimaryKey ( or maybe an index - i...
5
by: datasec23 | last post by:
Hi...I am trying to get my listbox data to change based on a field on a form. Each time I click on the next record indicator at the bottom of the form, I would like the Listbox to change...
5
by: Academia | last post by:
(If you've seen this in the drawing NG, sorry. I inadvertently sent it there.) I have a listbox populated with Objects. The Class has a String field that ToString returns. I assume that...
7
by: BONES7714 | last post by:
Hello, This is my first post to any sort of forum although I've used them to learn the very little Access/VBA that I know so please forgive my ignorance. I work for the National Guard as Combat...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
1
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.