Forms :: Allowing Different Values In One Field Depending On Selected Values Of Another

Nov 22, 2013

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"

[code]...

View Replies


ADVERTISEMENT

Forms :: Populate Combo Boxes With Values Depending On Selected Value In Previous Combo Box

Aug 5, 2013

I have several comboboxes (6) on my form.How to populate these comboboxes with values depending on selected value in previous combobox.

Example.Lets say that you select value "Audi" in combobox 1, then available values in combobox 2 should be "A4","A6","TT" etc. and if you selected "BMW" in combobox 1, then available values in combobox 2 should be "3-series", "5-series" etc...

View 1 Replies View Related

Forms :: Combo Box Allowing User To Edit List Values

Nov 2, 2013

I have a subform in a form that has a Combo Box that is linked (not sure is that is the correct term) to a field called PartID in a table containing a list of Parts. The list show the Name of the Part (PartName) and other fields.

This all works great except that it allows the user to change the text in the Name of the Part (PartName) field directly from the Combo Box!!!! I really don't want this to be able to happen.I have the "Limit to List = Yes" but it still allows the user to change the value...The "Allow Value List Edits = No"...

View 2 Replies View Related

Queries :: Calculation Based On Values Selected In Table By Looking Up Corresponding Values In Other Tables

Aug 29, 2014

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).

View 5 Replies View Related

Limit A Field To User Defied Values Depending On The Input Of Another Field.

Nov 23, 2005

Hey all,

I have two fields 1 & 2

field 1 is a simple combo list of user defined values ie A, B, C or D

Field 2 relates to a attribute of the data in field 1 and is not always the same for A, B, C and D. i.e

A could have a,b,c,d or e
B could have c,e,f,g or h
C could have a,g,h,i or j
D could have v,w,x,y or z

I would field 2 to have a combo box which only displays a,b,c,d, or e when A is chosen in field 1; c,e,f,g or h when B is chosen; etc

How do I do this?

Cheers all,

Matt :confused:

View 2 Replies View Related

Forms :: Pulling Top Values Randomly Depending On Value Entered Into Textbox

Dec 8, 2014

I have a textbox & button that when entered & pushed - run a query for the top values randomly depending on the value entered into the textbox.

My code is...

strSQL = "SELECT TOP " & Me.Text140.Value & " [CAN - NAME].Name, [CAN - CPT/VOUCHER].Voucher_Number, " & _
"[CAN - CPT/VOUCHER].Procedure_Code, [CAN - CPT/VOUCHER].Service_Date_From, [CAN - CPT/VOUCHER].Patient_ID, [CAN - CPT/VOUCHER].service_id, Rnd([service_id]) AS RandomNum " & _
"FROM [CAN - CPT/VOUCHER], [CAN - NAME] WHERE [CAN - CPT/VOUCHER].Service_Date_From Between " & Me.StartDate.Value & " And " & Me.EndDate.Value & " ORDER BY Rnd([service_id]) DESC "

It runs like it should but doesn't populate any records...that is until I go into the design view, deselect one of the fields and then reselect the same one - only then does it populate.

Do I need to open the query first and then update/append instead?

View 5 Replies View Related

Forms :: Adding Combo Box To A Form Depending On Input Values

Sep 23, 2014

I want to add a combo box to a form, where depending on the values entered in the box another combo box would show more values. In other words, if the first combobox had choices of 1, 2, 3 and 4, if 1 was selected the next combo box would have values a, b, c and d. If 2 was selected, it would have values of a, d, e, f and g.

View 2 Replies View Related

Calculations On Selected Values From One Field

Oct 24, 2007

I have a table with the following logical structure:


Name...Number eaten of apples......Number of eaten oranges.....All fruits

Mike...............3.............................. ..........4...........................7
John...............5.............................. ..........3...........................8
Peter..............2.............................. ..........2...........................4
Phil.................1............................ ............4...........................5

Question 1:
Can I calculate in a query sum totals for apples (or oranges or all fruits)
eaten by Mike and Peter together and ignore John and Phil?

Question 2:
How can I get sum totals for everybody excluding just Peter? Or Peter and Phil?

Your help will be very much appreciated!

Aleksandr

View 3 Replies View Related

Tables :: Linking Multiple Field Values To A Field Selected From Combo Box

Feb 16, 2014

I'm pretty good with setting up a very simple database such as inventory, profiles, etc.. However I'm creating a database to keep track of a football (soccer) team's players and match statistics.What I have so farsample attached)

Tables:
* Players - PlayerID, Fname, Lname, position, goals, assists, etc (all details regarding a player)
* Position - Positons (Table containing positions eg: defender. Data is selected in player's form as a combo-box)
* Competition - Competition types (Cup, League, Friendly. Data is selected in Match's form as a combo-box
* Venue - similar to Competition table
* Opponent - Similar to above two tables
* Match - MatchID, Competition, Venue, etc (form corresponding to table attached)

Forms:
* Player form
* Match form

Now as shown in the sample, I choose players using the combo-box. Then whatever stats they had during the match are entered on the fields provided. How to link the player (selected using combo box) to the stat fields (goals, assist, YC, etc).

View 1 Replies View Related

Forms :: Save Button Which Writes Selected Values To A Table

Jan 28, 2015

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.

View 7 Replies View Related

Update Values On Table 1 Depending On Dates

Sep 19, 2014

What i need:I have the attached database which includes 2 tables (Table1 and Table2) which are related One-2-Many (Table1 is the One and Table2 the Many)There is one form also with the name "Form1" which includes 11 unbound (ctr1,2,3...11) and are calculated with the values of fields [MainDate] , [Days] and [EndDays]

The Issue: As you can see in the attached sample, on Table1 i can assign the "MainDate" value , the "Days" and on field "EndDays" i can have the value of the [MainDate]+[Days].

I need to update the field "RefNo" on Table1 on depending the date range of the field [EndDays] and the controls [ctr1-11]. Specifically i need : If the Date() is in the range of eg. [EndDate] and [ctr1] i need to have the value of the first record of the Table2 (RefNo) on field "RefNo" into Table1. If the Date() is the range of [EndDate] and [ctr2] i need the second record values of the field [RefNo] into Table2 and so over..

View 1 Replies View Related

Queries :: Rename Field Values With Values From Another Table

Mar 2, 2015

I have two tables.descriptions I'd like to relate and use to find/replace in bulk.

[Checking].[Description] (with the source data)
[Rename].[NewDescription] (with the correct data)

I'd like the values in [Checking].[Description] to be replaced with the values in [Rename].[NewDescription], including those that are "Like".

Examples:
[Checking].[Description] = Geico 12345
[Rename].[NewDescription] = Geico

[Checking].[Description] = Geic
[Rename].[NewDescription] = Geico

View 4 Replies View Related

Automatic Update For A Field Depending On The Value Selected In Another Field.

Mar 28, 2007

tblAppointment will take register appointments.

tblTreatment contains Cost for different AppointmentTypes.

The above two tables are linked as 1-M relationship (1 Treatment can have Many Appointments)

Entering data in the tblAppointment - AppointmentType and AppointmentCost are the fields in tblAppointment. AppointmentType a drop down box, so that a specific AppointmentType can be selected.

Problem: Now depending on the AppointmentType selected the AppointmentCost field should automatically display the correct Cost.

Can anyone help please?

Thanks

Paz

View 2 Replies View Related

Forms :: Default Values Disappear If Put Values In Text Boxes

Sep 17, 2013

In Access 2010 I have a Data Entry Form on which I have an unbound textbox in the header that the user can put a default date in. In the body of the form is a bound textbox that records the date and the default value is set as =defaultdatestat (obviously the name of the box in the header).

Problem: The default date shows up perfectly until a value is put in any of the other text boxes.

For further info : If you put values in text boxes default value disappears; if you then push escape the default value reappears when the values in the text boxes disappear.

View 4 Replies View Related

Adding Only Selected Values In A Row

Sep 22, 2006

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.

View 1 Replies View Related

Sum Field Values Only If Another Field Values Meet Criteria

Mar 20, 2015

I need for Access only to sum the "hours worked" of my payroll data, only if another field, "pay code" meets a certain criteria.

In Payroll, some codes are used to designate actual hours worked like REG (Regular Hours) and like OTS (Overtime Straight) while other codes are added as "premiums" to these hours and do not mean that you actually worked those hours, like OTP and HOD (Overtime Premium & Holiday Premium). The hours are only added as a reference to the actual hours worked they are attached to. Their units should not be counted as hours worked.

I want Access to 1) Group By Cost Center, 2) Sum "Hours Paid" that are tied to a REG or OTS (only), but 3)Sum the Earnings for all pay types.

Basically, (in excel-like terms: Hours Paid Column= SUMIF of Paycode = REG OR OTS. But Earnings Amount Column= Sum of all Paycodes)

Cost Center
Job Type
Hours Paid
Pay Code
Earnings Amount

20530
Security Guard II
7.5
REG
190.37

[Code] .....

View 14 Replies View Related

Reports :: How To Add Selected Values From All Comboboxes To A Report

Jul 19, 2015

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

[Code] ....

View 6 Replies View Related

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

View 2 Replies View Related

Modules & VBA :: Deleting Values From A Table Selected From A List Box

Mar 19, 2014

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.

View 7 Replies View Related

Forms :: Insert A Field That Sums Up / Aggregate All Values Of Field

Jul 25, 2014

i want to add a control in that form that sums up and aggregate all the values of field called [amount] based on the value of [Name_Patient] as criteria

View 2 Replies View Related

Multi Select Listbox To Pass Selected Values To A Query

Jan 30, 2008

All -

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

Call:
Call fMultiSelect(Forms!frmPreSPIPComp!lstProjects)


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.

Any ideas? Thanks!

View 5 Replies View Related

How To Disable Subform Untill Values Selected In Main Form?

Jun 29, 2005

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.


http://i5.photobucket.com/albums/y180/method007/disablesubform.jpg

(form picture)

View 3 Replies View Related

Tables :: Unable To Insert Multiple Values Selected From Listbox To Database

Nov 19, 2012

i am trying to insert multiple values that i have selected in my listbox to my database access table when i click the "add record button" but the values does not appear in my database table.

i have 2 listbox, when i select the first list box(businessNature) it will display the records in the 2nd list box(lstCuisine). However, the records in the the lstCuisine list box is not entered into the table in my database.

(ps: in my property sheet for my lstCuisine listbox its multi select is simple)

Here is my codes:

Private Sub Add_Record_Click()
If IsNull(Name) = True Or IsNull(Mobile) = True Or IsNull(Email) = True Or IsNull(CompanyName) = True Or IsNull(BusinessNature) = True Then
MsgBox "Please fill in Business Nature, Name, Contact, Email and Company Name"
Else
DoCmd.GoToRecord , , acNewRec
End If
Dim conceptValue As String

[Code]...

View 10 Replies View Related

Forms :: Passing All Field Values From One Form To Another

May 28, 2015

I have "LossForm" to record loss of inventory items due to damage, theft, etc. It has "Loss Subform" for input of multiple items. The row has a calculated field "TotalLoss" (from qty * itemcost). The footer of subform has unbound text field =Sum(nz([TotalLoss])). This all works fine. The problem I have is that I need to pass the total to another form. I want to have a pop-up form to use some of the field values from the Loss form. I have been able to pass all of the field values except for the TotalLoss.

LossForm Close Event: "DoCmd.OpenForm "Journal", , , , acFormAdd, , Me.LossID & ";" & Me.LossDate

pop up form:
Set frmPrevious = Screen.ActiveForm
Me.TransactionID = frmPrevious.LossID
Me.EntryType = "Loss"
Me.Date = frmPrevious.LossDate
{ Me.Amount = frmPrevious.TotalLoss doesn't work }
DoCmd.Save
End Sub

I also tried to setup a global, class, and module variable but keep getting error message of undefined variable.

View 2 Replies View Related

Forms :: Values Change According To Selecting Value From Another Field

Apr 16, 2014

I am working on a school database, today I am working for fee collection form and I am facing trouble.In attachment At the top right area the hidden field I would like here changes according to selecting Fee Type under Fee Detail. I want to achieve this,

If feetype is ABF then Hidden field = 1500110
If feetype is ASF then Hidden field = 1500120
If feetype is EXF then Hidden field = 1500130
If feetype is MTF then Hidden field = 1500140
If feetype is RBF then Hidden field = 1500150

How I can perform this ?

Table structure is
(tblstudents) Contain students data
(tblFee) Contain, Student Id linked with student table, month, year, amount, date, narratives and FeeType that looup values from FeeType tbl, this hidden field also in tbl fee.

The codes that are 1500100,1500120,1500130

These are necessary for GL entries that's why I must have it on my form. I had as well apply method of Default value but in that case I only present only a single value, but I want that in hidden field values take changes according to the fee type.

View 3 Replies View Related

Forms :: Hide Unchecked Values In A Listbox - Create Hyperlink On Listbox Values?

Jan 20, 2014

Firstly, is it possible to hide unchecked values in a listbox? I have a user with several roles and I want to only show the ticked roles in the listbox.

Secondly, can you create a hyperlink on listbox values? i.e, if I click on "Manager" in the roles listbox, it follows that to another form and opens the record about managers?

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved