Automatically Refreshing My Listbox
Jun 23, 2005
My main form that displays the records also has on it a listbox for easier navigation to records. What i would like is when i delete the records, they automatically become removed from the listbox.
Currently what happens is that i have to close the form and reopen it in order for the deleted records to be removed.
I would like a line or two of codes that i can add to my delete record buttont that updates my quicksearch listbox.
View Replies
ADVERTISEMENT
Jul 11, 2007
Hey all. I posted this over at Mr. Excel too on the Access forums, but I thought maybe someone from this site might know the answer to my question.
I know pivot tables and charts are more up Excel's ally, but my question has more to do with Access I think. I've made a pivot table form from a query and everything is working fine except one thing. I want the table to refresh automatically. I don't want the user to have to go in and refresh the data manually.
I'm thinking I could put something on the forms "On Open" event but I don't know the specific coding. If anyone has any idea on this, I'd greatly appreciate some feedback.
View 3 Replies
View Related
Dec 9, 2012
is there any way for a table to refresh on its own after entering a new record?
i tried me.requery but it doesn't seems to work.
View 1 Replies
View Related
Oct 20, 2005
Hi All,
I have a Listbox [ListRandom], that populates a random selection of employees. The listbox is set to "Multiple Select = Simple" What I have now is: I can select several employees and then click a [print] button, this prints an individual form with those employees information, and then adds them to a table [tblselected]. What I am trying to accomplish is After those employees are selected, printed, and added, I then want to go back to the random list to select the other employees, but I would like the first ones that were selected/highlighted to refresh and be gone, so that I dont accidently add the same employee twice.
Is this possible?
And can someone point me in the right direction.
thanks....Enviva
View 3 Replies
View Related
Dec 9, 2012
Is there any way for a table to refresh on its own after entering a new record?
I tried me.requery but it doesn't seems to work...
View 2 Replies
View Related
Apr 21, 2006
Hi, I'm new here, so I hope I'm posting this in the correct place. I've searched the forum to see if there are any existing threads that might help me, but I've not found anything that does...
(I think this thread ( http://www.access-programmers.co.uk/forums/showthread.php?t=93444&highlight=Copying+data )may be trying to achieve something similar to me, but I'm a beginner and don't really understand it)
I shall stop waffling! I'm not entirely sure that what I'm trying to achieve is possible, I expect it probably is!
Right, I have a form (frmGroupRegister, which contains exactly the same fields as the table it comes from, tblGroupRegister), which consists of three things:
-GroupDate - The date a group took place on. It is my primary key, as no more than one group occurs on a specific date.
-ParentList (A listbox which contains a query showing the ID number, forename and surname of everyone in a table, tblParentDetails)
-ParentsAttending (A blank listbox)
I would like to place buttons in between the ParentList and ParentsAttending, which would allow users to conduct a 'register' of attendance by copying individual/multiple details from ParentList into ParentsAttending (much like you get when choosing which fields to include in a form when using a wizard for example). I would also like them to be able to remove people from ParentsAttending by using a button in case of accidentally adding the wrong person into the ParentsAttending box.
I'm aware that another, probably simpler way of achieving this would be to use a tick-box system, but I feel that visually, the first method would both look better and demonstrate who is present more clearly.
Any help would be much appreciated, but my Access skills are quite basic and things will probably need to be spelled out for me.
I'm using Access 2000 and Windows XP.
Thanks for your help,
Alice :)
View 1 Replies
View Related
Jun 10, 2015
I am using the selections made of the form to generate a query for the user.
I have a CITIES listbox that is populated with values from a stored query.
I would like to make it multi-select and populate a LOCATIONS list box and a NAMES list box based upon the CITIES that are selected.
I have the locations currently populated from a stored query that reads the City selection from the Form. It looks like this
Code:
SELECT DISTINCT (t_location.LOCATION) AS Expr1
FROM t_location INNER JOIN t_asset_master ON t_location.LOCATION_PHY_ID = t_asset_master.LOCATION
WHERE (((t_location.CITY)=[Forms]![MasterQueryGenerator]![CityList]));
I also want multi-select so that is you can un-select all and get the results for all cities.
Here is my half thought approach.
Code:
Private Sub CityList_AfterUpdate()
'Dim LocQryStr As String
'Dim r As Integer
'Dim ctl9 As Control
'LocQryStr = "SELECT DISTINCT (t_location.LOCATION) " & _
[Code] ...
I intended to have the variable LocQryStr as the row source but I abandoned the idea of having multi-select when I saw that .Selected(I) never returned true. Its like the values aren't read in this subroutine.
View 5 Replies
View Related
Sep 9, 2013
I have a list box called "product list box" based on a query called "searchqry", i also have another listbox called "type list box" , how do i get the type list box to only show "types" based on the section in products list box?
View 1 Replies
View Related
Jun 17, 2005
Hello all I hope that you can help
I got a database that has lots of subform which are all locked, I got a button that open the same subform in a pop up form with a macro that insert a new record. But when I close the subform after puting the information in the new record does not update on the main form untill you go away from the current record and come back again
Any Ideas
Postieman
View 1 Replies
View Related
Dec 14, 2014
Using a popup form
1. On my main form, I have a listbox, I would like to edit the values of the listbox.
To do this, I have a popup form with 2 listboxes, one to have the values of the listbox on the main form, and the other listbox with option values for the 1st
1) how to i pass the rowsource sql of the listbox on the main form to the listbox on the popup form
2) how on closing the popup form, do i update the rowsource sql listbox on the main form from the changed value of the popup form listbox rowsource sql
View 3 Replies
View Related
Oct 23, 2013
Okay then, after much trouble and confusion, I finally realized I need to use an Extended listbox in order to allow for multiple items to be selected from a list on my form (rather than the evil multiple selection combobox!).
However, now I am trying to figure out how to make one listbox (IndustryClassification) only be visible if the item "Industry" is selected in another listbox (TypeOfBusiness). Coding I can use for this in the AfterUpdate event of the listbox?
View 7 Replies
View Related
Nov 22, 2005
Hi there.
I have a form with two sub forms on it. The form loads with a reference number that I pass to a function that in turn requeries the first sub form. The function call is in the on load event of the main form.
This part works fine.
The second sub form uses a similar requery function to the first one. The only difference is that the query for the second sub form is based on a reference number from the selected record in the first sub form.
If I put the function call for the second sub form in the on click of the first one all is well and the second sub form displays all records with a matching reference number.
The problem is that when the main form loads the first sub form will display the correct data but the second remains blank or displays the wrong data.
I know this is happening because the first sub form has not loaded fully and so the second sub form cannot get the reference number. I just can’t find a way to make the second sub form display the correct data when the main form loads.
I have tried calling the requery function for the second sub form from most of the events on the main form and many of the events on the first sub form but to no avail.
I also tried putting a meaningless sub form at the bottom of the main form and putting the requery function for the second sub form in the on load event but that was no good either. This surprised me as until that point I was assuming that access was loading the sub forms sequentially from top to bottom.
Can anyone tell me how I might determine the point at which the first sub form has been loaded so that I can get access to the reference numbers needed for the second sub form query. I would prefer not to use a timer for this as there is no way to determine the maximum time it will take access to load the rest of the data but at present it looks like the only option left.
Any comments would be much appreciated and sorry for the lengthy explanation.
View 6 Replies
View Related
Nov 24, 2005
I just added a ActiveX control to my program and I have a scroll mouse, and there when the user used the mouse to scroll through the records, the record changes but the ActiveX Control doesn't. My activeX Control is used for a digital signature. Anyone Have any ideas?
View 2 Replies
View Related
Jul 27, 2006
This is a lot more complicated than the title suggests. I was asked to reset the work order numbers used by the maintenance department. When they reach work order #9999 they want to start over. My best bet is to make a backup of the tables and create new ones that include the last 2-3 weeks of activity. If I do that I'll have two potential problems:
The next autonumber needs to be lower than the pre-existing records but not start at 1
Recombining data from the old table (for whatever reason) will create false relations
Does anyone know a possible solution to these problems or is there a better method to refresh the database?
View 8 Replies
View Related
Apr 1, 2007
I have a 'Snapshot' report, which gives up-to-the-minute data on a business - sales year-to-date, month-todate, week-to-date and today. They run this many times a day, but ideally, they would like to have the information display on a monitor, and be updated automatically every few minutes.
Is there any way that a query can run by itself every few minutes, and gather the current information?
Robert
View 4 Replies
View Related
Jul 4, 2007
Hi Guys
Quick question, in Access 2007, i created a table that pulls data out of our system via ODBC. No if the system gets updated, how do i refresh data in access? Please advise. Thanks in advance.
View 1 Replies
View Related
Feb 24, 2005
I have an orders form which contains an items subform.
To populate the items subform I have a button which opens a separate pop-up form.
Is there a piece of code which would allow me to click a button on that pop-up form which actually refreshes the other opened form (orders form)???
Anyone know if this is possible?
Thanks,
Paul.
View 2 Replies
View Related
May 16, 2005
Hi all,
I have a form (sub_Main) that opens and has an openargs value (Department) from my main form when user clicks on a cmd button. However, if I were to go back to my main form and click on another department the openargs value is not passed along. I have tried using Me.Refresh under LostFocus but it doesnt seem to work.
What is causing the openargs value from updating? Any help?
Thanks!
View 5 Replies
View Related
May 26, 2005
Hey All,
I have a field "NameView", irrelevant but it grabs a name from a seperate form from an ODBC connection.
The purpose for the field is simply to grab the data from another form.
On the same form As NameView theres another field "Name"
This Grabs the data from NameView and writes to the main table.
Everything works fine but "Name" will only update from "NameView" on a new record only and not on the current one.
I have a VBA Statement on an afterupdate which Me.Name = Me.Nameview
I've tried Me.Refresh and Me.Requery but no help.
Any thoughts?
Much appreciated
Thanks
View 4 Replies
View Related
Jul 15, 2005
Hi,
I know this is probably something really simple - but I'm relatively new to VBA.
I'm trying to run an update query from a form, then refresh the form having all the input boxes and checkboxes etc set back to normal.
The problem being that I have a list box to select a record to update from.
Now, if I just refresh the form this list box updates properly - but none of the other controls (text boxes and check boxes) reset to their defaults.
If I try to reset them manually in the code then a) they don't reset and b) the list box no longer updates (depending on the location of the reset code).
Though the code I'm using to reset things works when the query is not executed.
The code I'm using is currently:
Private Sub Save_Record_Click()
On Error GoTo Err_Save_Record_Click
Dim stDocName As String
DoCmd.RunCommand acCmdSaveRecord
stDocName = "Return to training"
'DoCmd.OpenQuery stDocName, acNormal, acEdit
Me.Refresh
Current.Value = False
Exit_Save_Record_Click:
Exit Sub
Err_Save_Record_Click:
MsgBox Err.Description
Resume Exit_Save_Record_Click
End Sub
I should add that in the above version of the code the list box does update but the check box still does not.
I'd really appreciate any help you can give me.
Thanks!
View 2 Replies
View Related
Dec 8, 2005
Hi
I double click a combo box which takes me to a new form. e.g. a purchase order form does not have an employee so they need to be added. When the employee form is closed i would like to refresh to combo box so the new employee appears in the combo box.
Please help
Thank you
View 3 Replies
View Related
Jan 27, 2006
I have no VB skills at all have to do everything with macros etc. So please keep any replies simple. I have a database for students, courses and tutors - all worked fine until the customer wanted each student to do 2 courses at a time. The whole database is designed for statistical returns ie females with child care responsibilities living in a rural area etc., and the Course Id has to be the same on each course table. I split the course table into 2 tables with the same data, made a course entry form which appends new courses to both tables. My problem is that when I select a course ie no 234 for course 1 and 345 for course 2 I cannot get the subform to show the data unless I go to the next/previous record and back again; when I do this the main form opens at record 1. Is there a macro or piece of code I can use to automatically refresh OR a macro that will go to next record and then reopen the mainform at the place where I started?
View 1 Replies
View Related
Feb 26, 2006
Hi!
I'd like to ask for your help in the following issue:
I wanted to refresh the filtering of my combo-list on a subform according to the change of a field on the main form.
With this
Private Sub supplierID_AfterUpdate()
Forms![invoices]![details1 Segédűrlap]![KombináltLista4].Requery
End Sub
it succeeded. But when I turn a page on the main form (to see records registrated in the past), the combo-list on the subform doesn't change (because Access doesn't get any after-update info - I guess).
But I'd like to use a solution that always watches the actual value of the main form displayed on the screen and so it changes the filtered list of the sub-form - combo-list according to it.
Please help if you have a good idea/solution to it.
(take care I'm beginner at Visual Basic)
Thanks
xxyyy
View 1 Replies
View Related
Mar 24, 2006
Hello all,
I have search the forum for two days and can not find anything about this promble so any help would be good.
I am using a linked picture i have then browser setup and works ok but my issue is that i can not get the picture to refresh its self, with out going into design view and then back to my form, i would hope that there is a solution to this.
Any links would be good or general help would be great as i am starting to loss sleep over this now.
Thanks in advance
Alastair
View 1 Replies
View Related
May 23, 2006
Is there a way where you can send the data on a form to a detination table without closing the form?????
It's probably the easiest solution but it's 4pm and nearly home time so a memory blank is upon me!
View 2 Replies
View Related
Aug 23, 2006
I have modal pop-up form1 showing list of items. There is a button that opens a new modal pop-up form2 (not subform) to add items to form1, form1 is still open behind form2. This all works fine, but when you click save button on form2 it saves new data to database and closes taking you back to form1
but does not refresh new data to form1 unless you (shift F9) or close form1 and reopen or use refresh button on form1.
I would like to have form1 refresh data as soon as form2 is closed from the save button. I can do a timer event on form1, but this flashes the screen...which is annoying. I have tried various methods to make this work but just can't seem to get it to work. If form2 was a subform of form1 then refreshing mainform would not be an issue. Can anyone shed some light on this?
View 3 Replies
View Related