Forms :: Show Selected Subform Items In A Table Field
Dec 9, 2013
Given a subform that lists items:
a
b
c
d
e
f
g
Given a table that contains a coverage field
customer coverage
smith a, b, d, g
How would I create a relationship between a subform and a coverage field such that when i multi select items in the subform, it will show what items are selected in the coverage field as in the example.
I'm trying to create a right-click event on a listbox that will copy selected listbox item(s) to a temp table. So far, I've got this code to acknowledge the right click:
Code: Private Sub List0_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = acRightButton Then MsgBox "You pressed the right button." End If End Sub
Problem is the selected item on the list box doesn't move until after the mouse down event so whatever code I would run would involve the wrong record(s).
I'm using Access 2000 and 2003. How to get the the correct record selected on mouse down, or point me to a working example of right-click functionality on a listbox.
The situation is i have two forms, looking at the same table, but the main table shows more records, I would like to select a record in the datasheet subform and have the main form flick through to the corresponding record.
I have a form which when displayed shows all the items on the table (usually 1 or 2) for a particular key.
The following row is part filled in awaiting further input for the rest of the fields of that row.
I have a button (exit) which basically closes the form but it also validates the (potentially) partial field ultimate row. If the user hasn't added any data to the partially filled row then I delete that row with this code.....
If IsNull(Me.Field1) or IsNull(Me.field2) Then ....If Not Me.NewRecord Then ........ DoCmd.SetWarnings False ........ strSQL = "DELETE * FROM [Component Swaps] WHERE [ID] =" & [ID] ........DoCmd.RunSQL strSQL ........ Me.Refresh ........ DoCmd.SetWarnings Trye .... End If
.... DoCmd.Close .... Exit Sub End If
This works. I have copied the exact code into the close event for the form but it seems like in that part of the code the previous row is being picked up.
So for example if I have 2 records on the table I display 3 rows (as 1 is created with partial data) thus
If the code goes through the exit event then Me.Field1 and Me.Field2 are Null and the record with the ID=3 gets deleted.
Going through effectively the same code for the close event Me.Field1 = "F11" and Me.Field2 = "F22" and the record doesn't get deleted (ID=2 as well)...
I have a suppliers table and a products table. Two forms, Stock form with combobox to list Suppliers and a sub form with combobox that lists Products.I want to select a supplier from the Stock form and then the combobox in the subform to only list products directly sold by the Supplier.Have dabbled in SQL as follows:
SELECT Products.ProductID, Products.ProductName FROM Suppliers INNER JOIN Products ON Suppliers.SupplierID = Products.SupplierID WHERE ((Stocksubform.SupplierID=Stock.SupplierID)) ORDER BY Products.ProductName;
I have 2 Listboxes the first list is based on a query I need to select items from this box or part of each item and move to another listbox. the items in the second listbox will be used in a report. I have previously posted on another forum with no real luck fyi. the query is put straight in the RowSource.
Can some one tell me why, on the attached database example, I can select multiple items from list boxes "TipoCliente" and "FaixaEt" through "frmClientes" form but they are not passed forward to table "tblClientes" ?
Try to onpen attached database example and use form "fmrClientes" and select multiple items at "TipoCliente" and "FaixaEt" list boxes by entering them with mouse click and Ctrl key pressed . Select also single item from "NivEns" Combobox and write anything on "Nome" and "Apelido" fields .
Go to the table "tblClientes" and you can see text fields "Nome" and "Apelido" and also the item "NivEns" from Combobox "NivEns" are all there but not the items you selected from "TipoCliente" and "FaixaEt" list boxes .
I'm creating an employee audit database, and, in the audit form, the user (ie. supervisor) can select a number of items from a listbox. Each item selected corresponds to an error that the employee has made, and, as such, the employee's Audit Score has two points deducted for each item that is selected.
Incidentally, there are other, solitary elements to the form, but this particular listbox houses a collection of items that are related under a single category.
The score is displayed at the bottom of the form, and it needs to update in real-time.
The problems that I am encountering are that I am unable to count the number of items selected and then I am unable to multiply that count by 2 (the point-value of each item on the list.)
All. using 2010. I have a form and a subform. my master and child links are set but when I scroll thru my form; my subform does not change to show the matching records. I do have an unbound search field for the same field as the master and child links. When I type in the search field for a record; the subform does change to that particular record. Do you think that has anything to do with it?
I have a list box that allows multiple selections [Inventory]. I also have a combo box that has multiple selections [Shows].
Right now, user selects from list box and from a combo box and clicks a button. On button click, the items from the list box are associated with the PK from the combo and stored in a junction table. This allows me to quickly associate many inventory items to one show.
I realized that there I currently have no way to prevent duplicate Inventory+show records in the junction table besides having a composite key. This would be fine except no records get inserted into the junction table if there's a duplicate entry.
Ideally, I think that the user should select from the combo box [Shows]. This should narrow down what shows up in the list box [Inventory] in a way that Inventory items already associated with the show are not displayed.
If I have 10 Inventory items and Inventory items 1-5 are already associated with Show 1; after I select the combo box, the list box only displays Inventory items 6-10.
Here's the associated code
Option Compare Database Option Explicit Private Sub cmdAddRecords_Click() Dim strSQL As String Dim db As DAO.Database Dim rs As DAO.Recordset Dim ctl As Control
I am using Access 2000 to build a database of car parts, and the cars they are currently installed on. I can assign each item on the "parts" table to a particular car listed on the "cars" table (or to its current location if it is not on a car). I can look at the cars individually, and have a subform that shows the parts currently assigned to that car in a list. That much is great, and is exactly how I want it.
Here is my question:
One of the fields in the "parts" table is "hours." Every time I use a particular car, I would like to increment each of the parts assigned to that car with the hours they were used. Ideally, I would have a form called "Use Vehicle" or similar, and in it I could select the particular car from a dropdown, and a subform would show the particular parts assigned to it. Then, I want to either: a) push a button with a particular time increment (like 0.25 hours) OR b) just enter a value in a box, which would then ADD that number to the "hours" field for every part in the subform.
I have a form that has four combo boxes on it that enable the user to select entrants in a golf tournament for tee off times and tee. (I have attached part of this database to this post) It all works fine but after selecting the first player in the first combo box and then selecting the second combo player I would like the player selected previously not to show up. Is this possible or do I have to rethink the way players are selected.
Any way, I have created a table "accountstbl" to which i have AccountsID, Accountnumber, Accountname, Accountaddress, Accountcontact fields.
My question is i created a form with a combo box linking it to the accountstbl and Accountname field. When i click on the combo box it lists all my Accountnames from the accountstbl which i want but i want to click on an account name and once selected it will show a report of the selected name.
Reading through lengthy pages there is reference to event procedures but this is code which i do not know.
Simples is me select name from combo box and voila you have a report of your selected account name.
I managed to count the performance of users. The only thing I need to do is to put the names of the users on the form (under different tab) so I can select them and they show their performance. The best would that they are showing up there in the form till I change the names. I use now a text field to write the name, but when I close the database and open, I need to add the name again.
If I could use somehow the names from the users stored in a table, that would be great.
I have a form that each day needs to be filled in by staff of their activities.
By selecting a date, I want to the textbox to display the contents of the comments memo pad field in the table (tblToday...columns are t_date and t_comments).
My very limited access and previous SQL knowledge has eluded me and cannot fathom how to get the text box to show data based on the date selected?
I have an Orders form (frm-Orders) that includes a subform (frm-Order Details Subform). The subform has line item totals.I want to be able to sum the line item totals and show the result on the main form, but I can't get it to work. Seems like it should be an easy thing to do.
Someone suggested I try this but it didn't work:
In the footer of the subform I created this expression - =SUM([Line Item Total].
Then in the main form I created a textbox with this -- =[Forms]![frm.Orders].[Form]![frm-Order Details Subform].[Form]![txtSum].
I'm new to access and am currently building a simple db customers table and jobs table, I have a setup a relationship between the 2 and have the jobs bt las a sub form of the customer, but only showing a small amount of the job data.
What I would like to do is be able to click on a specific job within the job subform and navigate to that record in the job form where I can see all the data about that job.
As my title states, that is my problem! I'm building search criteria from a form and have multiple list boxes... I want to be able to determine whether or not a list box has items selected or not. I have tried as many things as i knew how to with no luck...
Also, i searched the forum but could not find what i was looking for -_-
I have a main form (frmMain) and a sub form (frmChild), set as datasheet. The first field in the datasheet is set as a hyperlink and opens another form correctly. What I would like is if the user selects a record on frmChild, then a textbox on frmMain is populated by the corresponding value in the second column of the datasheet. Is it possible to do this via vba, and if so, how? I've read about solutions by using continous forms, but I'd like to stay with datasheet format if possible.
In Access 2010, if you have a form with a subform in datasheet view, and you move the focus away from the subform, how can you tell which record(s) on the subform are selected?
When the subform has the focus, the selected row is shown with a blue/grey tint. But as soon as the subform loses the focus, this disappears and all rows look identical.
Its an issue as I have 2 datasheet subforms on my main form, with the 2nd showing records related to the record selected in the 1st. But as soon as the 2nd subform receives the focus, it is impossible to see which record in subform 1 was selected.
I have tried conditional formatting, but that does not work.
Hi all, greate site and i have been able to solve most problems by using the search box although this problem is doing my head in...!!
I have a db that records project numbers and their details. I am using a listbox to allow a user to multiselect Project Involvements Tasks(ie Documentation, Build etc) against a project number.
I am able to read the selections into a separtate table with two columns which is structured as:
as you can see I dont have a problem getting the Itemsselected into a table... the problem that i am having is getting them out again when the record is displayed - ie marking them as itemsselected.
I believe that the event would be onCurrent which would loop through this table pick up the project number and recorded invovements and mark them as selected in the listbox. if there is no invovement then the listbox would show no selections.
I am using this code to read the selections in
=========================== 'Records project involvements against project Public Function AddInvolvements(ctlRef As ListBox) As String On Error GoTo Err_AddInvolvements_Click
Dim i As Variant Dim dbs As DAO.Database Dim rs As DAO.Recordset Dim qd As DAO.QueryDef Dim strDelete As String
Set dbs = CurrentDb Set qd = dbs.QueryDefs!qInvolvement Set rs = qd.OpenRecordset
'Delete records where project number exists against an invovelment incase of involvement changes strDelete = "Delete Project_Involvement.ProjectNo " & _ "FROM Project_Involvement " & _ "WHERE (((Project_Involvement.ProjectNo)=[Forms]![Add_Project_Details]![ProjectNo]));"
For Each i In ctlRef.ItemsSelected rs.AddNew rs!InvolvementType = ctlRef.ItemData(i) rs!ProjectNo = Me.ProjectNo.Value rs.Update Next i Set rs = Nothing Set qd = Nothing
Exit_AddInvolvements_Click: Exit Function
Err_AddInvolvements_Click: Select Case Err.Number Case 3022 'ignore duplicate keys Resume Next Case Else MsgBox Err.Number & "-" & Err.Description Resume Exit_AddInvolvements_Click End Select
End Function ===================================
Any help would be much appreciated - also thanks to Pat Hartman for his excellent examples esp http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=54924