Forms :: List Box Updating Using Another Listbox Value As Header?
Sep 14, 2013
I need to construct a very complex student/coach/time/day Database.
Every student can attend a lesson twice a week, on a particular day and time with a particular coach.
Every coach has his/her own time table (Days available, times available on those days).
So I want this effect on a form:
Day: Monday
Coach: Jack
Time: 10:00
So Coach is dependent on Day, Time is dependent on BOTH Coach and Day.
I got the first one working but I am stuck on the second.
I created a Table for every day of the week (Mon through Friday) and have each coach's name as the "header" of a column, in that column I have the times they are available:
Code:
Jack - Roy
08:00 - 09:00
08:20 - 09:20
08:40 - 09:40
In my form, in the event procedure of the second list box I have the following:
Code:
Select Case [Swimming_Day_1]
Case "Tuesday"
[Time_1].RowSource = "SELECT [Coach_1].Value " & _
"FROM [Tuesday Times] "
End Select
But now when I select for example "Jack" in the "Coach_1" List box, the "Time_1" list box lists 3 entries of "Jack", not "08:00, 08:20, 08:40" respectively.
How can I accomplish the above without having to create a separate Day/Times Table For each and every coach (There are 8 coaches and 5 days, and I want things as easy as possible to update coaches should there come extra or some leave maybe).
View Replies
ADVERTISEMENT
Jul 30, 2013
The following code works to change the column header name for a listbox in form view when the data source is a local table, but not when the data comes from a sharepoint list.
Code:
sqlstatement = "SELECT ID, PONum as [PO Number], ActDate as [Date], VendorName as [Vendor Name], Service, BuildingNumber as [Building Number], ReservationDescription as [Description], POAmount as [Amount], QuoteType as [Type of Quote], Comments" & _
" FROM ActivityLog" & _
" WHERE (Activity = 'AcceptReservation') AND (PSCName = '" & Me.PSCCombo4.Column(0) & "')" & _
" ORDER BY ActDate;"
'MsgBox sqlstatement
Me.EditPOListBox.RowSource = sqlstatement
sqlstatement = ""
Also it appears that there is no such thing as a caption property for a sharepoint list column.
View 3 Replies
View Related
Apr 2, 2013
I have created a list box, but is by default sorted by the first column. I would like to sort the list based on other column. I also would like to have the headers of the tables in the list box. I don't also know if this is possible, if so, how to get a header in a list box.
View 3 Replies
View Related
Jul 18, 2006
Anyone know how to reference the name or header of a particular column in a listbox control?
i've tried,
Me.lstBox.Column(1).Name
Scott
View 2 Replies
View Related
Sep 20, 2013
i have created a form and its working correctly. however i have just been informed some of the fields needed deleting and different ones put in their place. so im just wondering if there is anyway to updated the field list so i can just add the new fields without having to recreate the whole form.
View 1 Replies
View Related
Apr 13, 2006
How do I return the Column Header Text on Right Click of listbox?
Thanks
View 5 Replies
View Related
Jun 14, 2015
I have a basic form linked with a subform inside of it. The main form has a list of customers in a combobox and the subform lists all the things they have ordered from us. This all works perfectly fine, I can add data to the list of things ordered and it's ok.
I decided instead of using a whole extra form to add customers I'd just have a not in list event and allow users to add customers through there, bit more intuitive and cut down on forms.
It works to certain extent except one small problem, if I add a customer I have to close and reopen the form to be able to add/remove data from them in the subform. If I leave the form open and try to enter in data in the subform immediately it just shows whatever customer I had last on the combobox and adds it to the last customer as well.
It works perfectly fine if I reopen it so I thought it was some kind of query or update snafu but all the VBA code examples I found don't seem to do anything. Not exactly sure where to go from here.
PHP Code:
Private Sub cboDept_NotInList(NewData As String, Response As Integer)
    Dim oRS As DAO.Recordset, i As Integer, sMsg As String
    Dim oRSClone As DAO.Recordset
    Response = acDataErrContinue
    If MsgBox("Add dept?", vbYesNo) = vbYes Then
        Set oRS = CurrentDb.OpenRecordset("tblDepartments", dbOpenDynaset)
[Code] .....
View 6 Replies
View Related
Dec 19, 2006
The header in a list box is derived from the data source. I have a list box that derives it's data from a select query, now one of the columns in the list box/query is an Expression (Expr1).
My question is, is there a way of replacing the column header "Expr1" with a more meaningful header?
View 6 Replies
View Related
Aug 23, 2013
Is it possible to have the header of a list box show the value of another control?
View 2 Replies
View Related
Mar 28, 2013
I have a combo box in the header area. The record source, Bound Column are set correctly ( I know because I tested it on a form ). In this instance, the user would select from the dropdown list, the name of a member of staff, based on the click-event, and passing the Staff_ID to a variable, this would be used to filter a recordset/recordsource for the report. However, there is no dropdown ( or arrow on combo - so no name can be selected ) ?
View 2 Replies
View Related
Jan 25, 2006
Greetings to one and all
I have a minor problem with a list box not updating that is driving me up the wall.
Here is what I have
I have a Form that has multiple pages (Tab control) and in one of the pages I have a list box that has row source of :
SELECT DISTINCT temp_wbs.Wbs_Element_No FROM temp_wbs LEFT JOIN my_wbsids ON temp_wbs.Wbs_Element_No=my_wbsids.Wbs_Element_No WHERE (((my_wbsids.Wbs_Element_No) Is Null)) ORDER BY temp_wbs.Wbs_Element_No;
The temp_wbs table is created after a user runs a process in a previous page, but when the user selects the page that has this list box – it is not updated with the current values from the temp_wbs table – it still contains old data.
However – when the user clicks a button on this page to delete their list (data from my_wbsids table) – the list box refreshes with the correct values from temp_wbs
What am I missing?
Any help in this matter is greatly appreciated
Thank you,
Kenny Louden
:confused:
View 4 Replies
View Related
Nov 27, 2006
Hi,
I've a listbox. Once i doubleclick on a data on this listbox an editing form will open.
I modify my data, save, close. But the data on the listbox are the same as before..
how can i update this data?? Something like once i saved & closed the editing form the listbox will update....don't know..
i've tried stuff like requery,refresh, ... but didn't work.. (was my mistake maybe)..:D
thx in advance
View 5 Replies
View Related
Oct 27, 2014
I am designing a nomination form (web database so no vba macros can be used).
The form has 3 combo boxes: cboStaffName, cboLevel, cboNominee.
The form is bound to the tblSubmit table where the submissions are populated.
I used a select statement:SELECT Staff_List.Staff_Name FROM Staff_List; to populate the combo box for the Staff Name selection.
This is the select statement to populate the job level combobox:
SELECT Staff_List.Level, Staff_List.Staff_Name FROM Staff_List WHERE (((Staff_List.Staff_Name)=[forms]![frmtest]![cboStaffName]));
The select statement to populate the combobox for the nominee combobox:
SELECT Staff_List.Staff_Name FROM Staff_List WHERE (((Staff_List.Level)=[forms]![frmtest]![cboLevel]));
The problem is that the staff_name in the first combobox is still found in the nominee combobox which should not be because a staff cannot nominate self. There is a field in the Staff_List called YesNo that should be activated for each staff that is selected so that the select statement on the nominee combobox can be updated accordingly to remove items with the field "Active"
How to get the checkbox selected for each corresponding staff.
Sample of the database has been attached.
View 4 Replies
View Related
Mar 16, 2006
Hi All,
Apologies if I'm posting in the wrong forum. Not quite sure whether this should be in tables or forms.
My question is, I have two tables, one containing general data and one containing data used to populate a listbox. I want the selected value in the listbox to be used to populate the corresponding field in the other table but my users want to be able to tab through the entry form. If they tab over the list box without actually selecting a value, the table is not updated with the listbox value. How can I make this work?
Hope that's clear and someone can help.
Many Thanks
Rich.
View 1 Replies
View Related
Oct 10, 2004
I have a listbox that navigates my form to a specific record based on ClientID
I also have a subform. This form has a field Called clientID which I want to pull all records with the current ClientID.
I can't get my subform to query only the records with the current ClientID in the ClientID field. How can I do this?
View 3 Replies
View Related
Apr 30, 2005
Hi
I have a database containing 3 tables (for now):
Customers
Orders
Catagories
Now i also have a form with customer information.
In that form is a listbox with a query statement, so that should display wich orders are placed by that customer.
SELECT Orders.[Order-ID], Orders.Description, Orders.Date, Orders.Category FROM Orders WHERE Customer=[Customer-ID];
Now this works for the first costumer record being displayed.
However when i view the next costumer, the listbox still displays the order information from the first customer.
How can i get the listbox to update itself when a diffirent record is viewed?
Thanks in advance
View 4 Replies
View Related
Jan 9, 2014
In my form I have the listFunctions list box set to Multi Select "Extended" in the following code contains a line to execute a query based on the selected items in a listbox. but for some reason instead of only changing the selected items it is changing all items in the listbox. I stepped through the code and it is looping the correct number of times based on the amount selected but is still changing all.
eg.if I select 3 items from the list, it loops through the execute 3 times.but the total 6 items will change.
Code:
Private Sub cmdEdit_Click()
Dim varItm As Variant
Dim sSQL As String
Dim ssSQL As String
[code]...
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
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
Feb 23, 2005
hello,
I have a list box and I use this to add stuff to the list. I loop through the recordset to add all the items to the list box i use this:
Me!RecordList.AddItem Item:=rst("id") & ";'" & rst("name") & "'"
This does not work, but if I put this down:
MsgBox rst("name")
Me!RecordList.AddItem Item:=rst("id") & ";'" & rst("name") & "'"
It works, but it brings up the message box for every entry. Anyone know what's wrong and how to get it to work?
This is part of a search, as the user is typing in the search box, for every character he/she hits it searches and displays search results in the list box. Is there a more efficient way of doing this? Thanks.
Thanks in advance!
View 2 Replies
View Related
Dec 16, 2014
I have a form that has combo boxes and text fields (as well as sub forms). There is also a button linked to some code that says'
Private Sub cmdQuote_Click()
'Creates quote date and prints quote
Me.QuoteDate = Now()
Me.cbAgentID.Requery
DoCmd.OpenReport "Quote", acViewPreview, , "BookingID = " & Me.BookingID
End Sub
When the button is pressed the QuoteDate field (it is bound) should be be populated, but unfortunately it is not. I have played with refresh and requery but cannot derive a solution.
View 1 Replies
View Related
Mar 28, 2005
I am working on a database for a bowling tournament. I'm currently working on a form where the user selects from a combo box bowlers' names for doubles pairings. I thought that as a helpful tool I would also display a list of available remaining bowlers once the combo box information has changed.
I'm trying to write a module for the combobox_change trigger. What I'm having trouble doing is pulling the updated recordset from the base form and using that to update the availability box -- in other words, how can you query data from the recordset underlying an open form before the form is closed and the data is saved to the tables. The only way I can do this now is to temporarily close the form, manipulate a recordset from the table, then re-open the form. There's got to be a better way. Maybe I'm just missing something here.
Thanks in advance for any help.
View 1 Replies
View Related
Aug 8, 2006
hi guys i have a list box which has 4 columns that come from a query. when a user double clicks a selected item, i want the frmUPdate to open with the selected item; it gives me no error it just always goes to the 1st contract . have no idea what else to try...
here is the code:
Private Sub List33_DblClick(Cancel As Integer)
Dim rs As Object
DoCmd.OpenForm "frmUpdate"
Set rs = Forms!frmUpdate.Recordset.Clone
rs.FindLast "[ContractID] = " & str(Nz(Me![List33]))
If Not rs.EOF Then Forms!frmUpdate.Bookmark = rs.Bookmark
DoCmd.Close acForm, Me.Name
End Sub
View 5 Replies
View Related
Dec 8, 2006
Hello,
I'm a beginner in the Access world.. had a two day crash course.
I am trying to populate my list box when I make a select in my combo box.
eg: Combo box-select vendor, which then would populate my Product Name box.
Can someone take a look at this datebase and give me some advice? I don't have a huge understanding of code..so please bare with me.
Thanks
:o
View 5 Replies
View Related