General :: Getting Values From Table2 Based On Value Selected In Table1
Oct 3, 2014
I have a table named Product and Quotation.
This is what i want to achieve
In Table Quotation when i select product name from dropdown menu i want all the related information for that product to be visible in Quotation like product id, productdescription & productcost
Hello everyone! I've found much use of this forum recently as I am working on a database concerning my work.
I'm not a newbie working with access but this problem seems confusing at the beginning.
I've got 2 tables 1) Information about produced details. Article, Mass etc. 2) Mass constants Mass min. Mass max. Constant
What I need, is to build a query that compares the mass of the detail with the range mass min. and mass max. and shows the mass constant that the detail belongs to.
Has anyone tried to solve this kind of issue before?
I want to be able to append data programatically once daily OnClose.Although users can log-off & on as many times,but the Append should be once & after then,update subsequent records for that day automatically from table1-table2.
I have two tables. both tables contain an id column (Integer) with the same values. Table1 contains the data I want. Table2 contains one column with boolean values.
So this is what I want (though it doesn't work at all)
FROM [Table1] WHERE [Table2].[BooleanVolumn]=true
So I want all the records from Table1 where the same record in Table2 have a true value in Table2.BooleanColumn.
This is hard to explain, but I hope you understand.
i have a database and i need to be able to read all the records from table1 modify the data and output the data to table2 and I would prefer this to be done via just one button in a form so im guessing VBA need to be used.
table1 consists of an ID field, firstname field, lastname field and date field.
table2 has ID field, full name field, date field
so i want to read the first and last name and date from table1, merge the first and last name and then output the merged names and date to table 2.
ive googled around and all ive come up against is recordsets but im having a hard time actually getting them to even work.
Table 1 (StaffID) - contains all personal details in the form of forename + surname + position + email + contact numbers ect. Each field/person has an autonumber.
Table 2 (StaffTrainingID) - contains all mandatory training/lectures (18 fields in total). I don't wish to list each staff member again in table 2 so have put a StaffID field in (data type is number).
However, when I try to type in the StaffID number in that field so I can link that person to the relevant training he/she has taken, Access won't allow it.
I'm using Access 2010. I need to calculate a score based on values selected in a table by looking up corresponding values in other tables. I have a "Project" form to create new entries into the Project table (see Table 1). When I create a new project record, I will select values for the Payback and Need fields by selecting options from a list. The Payback list is pointed at Table 2 and the Need list is pointed at Table 3. In the below example, I created the "ABC" project and selected "1 year" for the Payback field and "Repair" for the Need field. Pretty simple.
Now that I have the "ABC" project loaded to my Project table, I'd like to create a report that will show a "score" for this project. The score should be calculated as follows: Payback Impact + Need Impact. In this example, the score should be 30 (Payback Impact of 20 + Need Impact of 10).
Is it possible, to input information from my continuous form into a web control form. at my job we a required to tract our jobs by equipmentid and job control number(jcn). When a job is done we have to upload the id and jcn into a website to tell it is cleared. I am looking for a way for that info to automatically be filled in when i load the website based on the job i have selected in my form?
I would like to set up rules/constraints such that the value selected in combo box A determines the available values in combo box B. For example, "Combo box A" is bound to the [PartnerType] field and "Combo box B" is bound to the [PartnerRole] field. Let's say that the two choices in Combo Box A are "LLC", "LP", and "Corporation". There are 5 possible choices in Combo Box B: "X", "Y", "Z", "Q", and "U". If a user selects "LP" in Combo Box A, I would like Combo Box B to only show choices "X" and "Y". And if a user selects "LLC", only choices "Y", "Z", "Q", and "U".
Similarly, I would like to set this up so that Combo Box B is not initially visible--it becomes visible when a user selects "LLC" or "LP". If a user selected "Corporation", Combo Box B would remain hidden.
I have a table with a few Listbox options. I want one of the columns' values to be determined by the value chosen in another field. How do I do this?
Example: In column A I choose value ABC from the dropdown. I want column B to now offer values in that list of DEF, GHI, JKL. If I chose XYZ in column A instead, I'd want the column B list to show MNO, PQR, STU. Etc.
I have several result fields which are all drop down lists. I want each result field's drop down list values to be different depending on the selected value of the Test1 drop down list.I came up with using the .rowsource keyword. My syntax seems to be fine but I'm not getting any values under the result fields when I run the form.Here is my code so far:
Private Sub Test1_AfterUpdate() If Me.Test1 = "Stress Echo" Or Me.Test1 = "Stress SPECT" Or Me.Test1 = "Stress PET" Or Me.Test1 = "Stress MRI" Then Me.Test1Result2.RowSourceType = "Value List" Me.Test1Result3.RowSourceType = "Value List"
Below is a sample of the table with the data. I manually added the 1 and 0 to the hc_Year field. However, I would like to create an Update query that will add a 1 to the hc_Year if its the first instance of PIDM & regsYear and add a 0 to the records that are not the first instance.
I could have many periods in a future. What i want is to allow users to insert just first start year and lenght of period and table will be automatically updated based on these two values.
So user will insert Period_Start_Year and Length of Period, for example 2010 and 2 and table should be>
While i am writing this i realised that user have to specify also ending year, i do not want to have infinity.. I am thinking about form and update query but can't get it...
i need to add values of about 20 items and store them in a feild of their own. any ideas of how. Tthe items each have their own value but i need to be able to add all of them up and divide the by the total p[ossible points. i know their is a way to do so but i cant get it to work on my own it keeps giving me an aggregate error.
I have a frmOpenReport which has 7 combo boxes linked to 7 Query's.
I have found code to add selected values from one combo box from a button 'Open Report' to a report but struggling to find how to select selected values from all comboboxs and add to a report.
My code so far.
Option Compare Database Option Explicit Private Sub cmdOpenReport_Click() On Error GoTo Err_cmdOpenReport_Click Dim strWhere As String Dim ctl As Control Dim varItem As Variant 'make sure a selection has been made If Me.HLO.ItemsSelected.Count = 0 Then
Im trying to delete values from a table based on the selected values of a listbox. The listbox values have a hidden column which related to the ID on the table to which I am trying to delete from (if that makes sense).
If I use the following code:
Code: Set ctl = Me.Results_listbox For Each varItem In ctl.ItemSelected CurrentDb.Execute "Delete * FROM Table1 WHERE Table1.ID = " & ctl.ItemData(varItem) Next varItem
I get an error stating Object doesn't support this property or method.
I have a form with 1 List Box. This list box contains the names(SSN, Department, Status) of the columns in TableA.
The question is, can I create just ONE query statement, and base the GROUP BY on whichever field the user selects?
For example, if a user choose Department, then the query will group by Department. I know how do this by the long way; meaning I create 3 separate for each,(qrySSN, qryDepartment, qryStatus) and if say the user select SSN, it will open the qrySSN query. This is way too much maintenance. I have a feeling there is a much easier way. Please advice.
I'd like to create a query which will consist of simple SELECT statements as follows:
SELECT [table1].[field1], [table2].[field1], [table2].[field2] FROM table1 INNER JOIN table2 ON ([table1].[fieldX] = [table2].[fieldX]);
The challenge arises b/c instead of joining on equal values, such as the following: [table1] INNER JOIN [table2] ON [table1].[field1] = [table2].[field1]
I would like to join based on equivalencies, such as: [table1] INNER JOIN [table2] ON [table1].[field1] = 34 is equivalent to [table2].[field1] = 2;
I do not know the proper syntax, so this is where I need help. I tried to search online without any success.
For the life of me I can't get the Multiselect Listbox to correctly pass along all of the item selections to a Query which a form is based on.
I've been up and down the forum, and I can't figure out what piece of code to use and how to use it successfully.
I've been able to get a string created using the example posted here (http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=47909) and it's in the format of "54,67,89,100" etc.
Public Function Public Function fMultiSelect(ctlRef As ListBox) As Variant Dim Criteria As String Dim i As Variant
' Build criteria string from selected items in list box. Criteria = "" For Each i In ctlRef.ItemsSelected If Criteria <> "" Then Criteria = Criteria & "," End If Criteria = Criteria & Format(ctlRef.ItemData(i), "0000000") Next i
fMultiSelect = Criteria gMultiSelect = Criteria End Function
I now need to pass that string to a Query. Once it's been passed to the query, I can open the report based on it.
Essentially I have a button that will perform the string creation, and I would then like to open a report. I want to base the report off of a query and then have the query use Criteria to dwindle down the report.
Am I missing something here?
The long explanation:
I have a single form that allows for the selection of the report. Once the report is selected, certain fields appear that allow for certain criteria to be selected (ie. Class Name, Multi-Select Class Name, Student Names, Multi select Student Names, Dates, etc.)
Once the report has been selected and the criteria set, a user hits a single button that runs the specific report.
Any better ideas of how to set this up. The reports will ultimately be basing their criteria on what the form has in all of it's unbound fields.
I also have a table that specifies the Display Name, actual Report Name for the button to figure out what report to run.
Bottom Line. I want to use a Listbox to filter a report. If I can use a query to base the report off of even better. I don't want to create the SQL in VBA.
Hi every body . I got a a form and sub form. I want to disable sub form untill the user finishes selecting values from combo box drop downboxes. I be happy if some one show me how to do this.
I have a form full of cascading unbound combo boxes which allows me to assign companies and people to a project.I have a save button which writes the selected values to a table.To view the assignments when the record is later viewed I have placed a bound field behind the combo box.
I'm this is a simple issue. I have a combo box which can have the following status's: Not Started, In Progress, Complete. Depending on the value of the combo box i want a different image to show. So if not started is selected i want the user to see a red box. If Complete is chosen, a green box will show. i can do this easily enough but my problem comes in when i go to the next record. The boxes just stay visible regardless of what option is displayed. What event is triggered when you go to the next form?? Form Open / Load doesnt seem to work. :mad: :confused: