Naming A Field Based On A Value From Another Field?
Dec 12, 2007
Hi all,
Is it possible to name a field (heading) based on the value of another field?
At the moment the code looks someting like this:
Sum(IIf([START_DATE]<=[CurrentMonth],IIf([END_DATE]>=
[CurrentMonth],[COST_PER_UNIT],0),0)) AS [ThisMonth Rate]
I would like to name the field based on the value of another field in the same table instead of the static [ThisMonth Rate]
Thanks again
Jules
View Replies
ADVERTISEMENT
Nov 4, 2005
Hi,
I need to name my field in my select query
i.e : - name: [...
but instead of it just being text, i need it to calculate its name by month i.e
Month([Starting date:])+1
On my query i ask the user to input a starting date and i then work out information based on that. How can i name the a calculated month
Thanks
k0r54
View 1 Replies
View Related
Jun 13, 2013
Is it poor practice to name form controls with the same name as the field names?
View 5 Replies
View Related
Feb 28, 2013
Within my table if Field 1 has an answer of Self (from drop down), then, I would like Fields 6-12 to auto populate; however, if Field 1 does not have an answer of Self, then leave Fields 6-12 blank.
I am not quite sure how to lay this out. I am using Access 2010.
View 8 Replies
View Related
Jun 30, 2015
I have my Assets form and the primary key is the ChargerID, in this form I have an "Add New Job For This Asset" button, which opens up the Jobs form at a new record.
How do I make it so that the ChargerID field is automatically filled with whatever the previous record was instead of being blank.
For example if I have Charger12345 open in the Asset form, I'd like to click the Add New Job button and it automatically have Charger12345 in the ChargerID field of the Jobs form.
View 5 Replies
View Related
Mar 4, 2008
I'm creating a database that keeps a track of questions and scores.
The questions in the database need to be dynamic and are changed frequently.
I have a scorecard table which keeps a record of scores and the applicable question at the time the record was saved. I need to do this because in 6 months time we may want to provide feedback. As the question may have changed we need to be able to refer back to what the question was.
I want the question field in my scorecard table to populate with the value in my question table.
I have tried a number of things including setting the question field in the scorecard table to a lookup based on the following query:
SELECT tblQ1.Q1
FROM tblQ1;
This works however only as a list or combo box. I don't want the user to have to select the question. I want it to auto populate, is this possible?
View 1 Replies
View Related
Nov 10, 2005
I need to create a New Form control for this situation:
If I enter a date into a field and the choice for another field is equal to a certain value. How can I get the date I entered to be automatically populated into another date field.
For example:
If I enter 11/10/2005 in a date field and I choose either "BN", "BA", or "BT" in a text field, I need that date of 11/10/2005 to be automatically populated in another date field on the same form.
Any help is greatly appreciated.
View 2 Replies
View Related
Jun 27, 2014
I (will have) a form which a user fills in to enter new data.
I have two fields,
"Branch" and "Branch ID" (Branch ID will not be on the form, just in the table)
Branch will be fed by a combo box with seven choices. I would like it so that when "Branch" is populated it autopopulates Branch ID with a code which relates to the branch, so for example
BRANCH BRANCH ID
Braintree BRA
Colchester COL
View 4 Replies
View Related
Sep 13, 2013
Using Access 2010. Fairly new to automation and macros.I have two tables (tblProductReceived and tblBins) and a form (frmProductReceived).A field in tblBins corresponds to a location the bin is at (named BinLocationID) and the tblProductReceived table tracks product that a specific bin has received.
What I need is for the tblProductReceived field PRLocationID ([tblProductReceived].[PRLocationID]) to be automatically populated with where the bin is at ([tblBins].[BinLocationID]) when selecting a specific bin in the form (frmProductReceived).
View 1 Replies
View Related
Jun 18, 2014
Table1 contain Two fields (3Months) and (6Months)
Table2 contain Two fields (3Months) and (6Months)
the table 2 is the source of a form that will let the user change the numbers. table 1 should change Date1 and Date2 Fields based on the two fields (3months) and (6months) if i want to make a lookup wizard it should be changed manually and if i make a calculated field i can't find other tables in the expression builder
View 1 Replies
View Related
Jun 28, 2013
I have two tables that are joined - called A and B. A has two fields, "PLACE" and "RAND" and is joined to B via field "RAND". Other than "RAND", B has several fields named 01 TOTAL, 02 TOTAL, 03 TOTAL, etc...for about 60 fields.
The "PLACE" field in table A has data that is 01, 02, 03, ect.... How do I structure a query so that whatever "PLACE" is, I can match the XX TOTAL value? In other words, i need to have the query field header be somehow dependent on the value in "PLACE".
Is this even possible?
View 4 Replies
View Related
Jun 4, 2013
I am making a very simple 'registration' database for a children's event in a couple of weeks.I the table/form there is a checkbox field called 'consent' which, if checked, indicates that a child can leave the event without parental consent.
There is a report printed on each child (a registration page which the leaders get a copy of). I would like on this report a 'red box' to appear if the child cannot leave without permission (i.e. the consent box is not checked). I would also like this 'red box' to appear on the form. I had thought of doing it this way - but I'm not sure if it's the best, or if it's possible:
Have a field in my table called 'consentindicator'. When the 'consent' box is checked, there is a period ('.') placed into the 'consentindicator' field. It is set to turn red when a period is present. That way, when the consent box is checked, a get a red 'box'.
View 12 Replies
View Related
Dec 5, 2012
I have a main table which is autonumbered on unitid, I have another table which is linked via the unitid which holds items purchased for the main table, so the second table is a subform of the suppliers and will have multiple entries of the same unitid. What I would like to do is when an item is entered into the second table, check the main table to see if it exists, if it does populate the unitid field with the unitid from the main table, and if not exist create a new record in the main table with the next unitid number.
This in essence is what I want, bearing in mind that the tblinvoices is a subform and the tblmain is not open.
If ([tblinvoices]![Unit] = [tblmain]![Unit]) Then
[tblinvoices]![UnitID] = [tblinvoices]![UnitID]
End If
View 3 Replies
View Related
Dec 3, 2013
I'm trying to complete a database.
It is to manage details of pupils with additional support needs, and plan for the extra arrangements the school will provide for assessments.
It has 2 Tables
tbl-PupilDetails
-ScottishCandidateNumber primary key (Unique number which identifies pupils to the exams board)
-Forename
-Surname
-DOB
-YearGroup
-Class
-NatureOfNeed (memo)
-EvidenceOfNeed (memo)
tbl-SubjectLevelArrangement
-ID Primary key, Autonumber
-Pupil foreign key to tblPupilDetails
-Subject
-Faculty
-Level
-Arrangement
I currently use forms for adding new pupils, and updating pupil subjects/arrangements/levels.
I also have forms to search for specific pupils, and to create lists for faculty heads showing which pupils are taking subjects within their faculty and the arrangements we expect to provide.
I use the forms to run queries, which can then output to reports for printing.
Where I am currently having an issue is the faculty field in the tbl-SubjectLevelArrangements. (If I didn't have to report to faculty heads I would just leave it out, but management will insist.)
Currently I have a form with dropdowns for adding subject, faculty, level and arrangement manually. This is acceptable for the subject, level and arrangement because they are completely interchangeable and dynamic throughout the academic year as pupils may drop down a level, or change the type of arrangement they require.
However as faculties are inextricably linked to subjects, I want to remove the possibility of human error. i.e. when a user (me) chooses either geography, history, or RE, then the faculty will always be Humanities, likewise if the user chooses French, German, or Spanish, then the faculty can only be Modern Languages etc.
I'm convinced there must be a very simple way to ensure that the faculty field prefills based on the limited keywords available in the subject field, but I just cannot figure it out.
View 6 Replies
View Related
Jul 22, 2014
Please see attachments.
POST.zip (384.0 KB)
database.zip (58.8 KB)
View 4 Replies
View Related
Dec 15, 2013
I made a report that have 'txtRemarks' field, I just want to get remarks automatically in 'txtRemarks' field based on the other field in report. that is why I used a function like below:
Code:
Private Function Estd_Remarks(Estd_Point As Long) As String
If Me.Estd_Point < 20 Or Me.Estd_Point = 0 Then
Estd_Point = "Earlier Established"
Esle
Estd_Point = "OK"
End If
Estd_Remarks = Estd_Point
End Function
And I wrote in properties 'On Format' event this code below:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Estd_Remarks = "Ok" Then
Me.txtRemarks = "Ranked & Sortlisted"
Else
Me.txtRemarks = "Estd_Remarks"
End If
End Sub
When preview the report then it shows
Compile error
Argument optional
View 3 Replies
View Related
Apr 11, 2013
I have a datase that has the following fields.
Name
Comment1
Comment2
I have about 36 names and each of those names appears anywhere from 2 7 times each. Each name entry has a comment1 and a comment2.What I would like to do is create a form that allows me to choosea name and the display the comments 1 and comments 2 in text boxes.
I have made the form to allow me to choose a name and it shows one of the comment1 and one of teh comment2 in the adjacent text boxes as planned but, I want all the comment1s for Bob to show in the text box for comment1 and all of the comment2s for Bob to show in the Comment2 text box.I believe I need to concatenate the results in the comment1 and comment2 boxes, but I do not know where or how I would do that.
View 5 Replies
View Related
Jul 17, 2015
I am creating a database tracking physicians and their contracts. I currently have two tables: PhysicianT and ContractsT, with corresponding forms to enter information in them. I have an issue with the Contracts form; I want to be able to select a physician from a dropdown list (looked up from PhysicianT) and have Access autofill their Physician ID #.
PhysiciansT looks like this:
physicianID (AutoNum) name (Calculated)
1 Barker, Bob
2 Burgundy, Ron
3 Stark, Tony
Upon selecting Barker, Bob from my dropdown list, I want "1" to appear in the Physician ID # field in my Contracts form.
View 3 Replies
View Related
Nov 8, 2004
KTYPE=text; EXPIRATION_DATE=date/time; OVERAGE=date/time
im doing a report based on a query (which has a few fields, including KTYPE, EXPIRATION_DATE, OVERAGE). im trying to determine the OVERAGE based on the following conditions:
here are the conditions:
if KTYPE="PO", then OVERAGE:=(EXPIRATION_DATE + 6 months)
ie.. KTYPE=PO, OVERAGE:=(01/04/2004 + 6 months) = 07/04/2004
if KTYPE="IAA", then OVERAGE:=(EXPIRATION_DATE + 20 months)
if KTYPE="FA", then OVERAGE:=(EXPIRATION_DATE + 12 months)
and so on and so forth.
I'm very new to Access. What formulas do I use and do I put the formula in the query or the report.
Please help. thanks in advance
View 2 Replies
View Related
Nov 10, 2005
If I have the following Code to disable a field based on the value of another field:
Private Sub lstAgreementType_AfterUpdate()
If Me.lstAgreementType.Value = "BN" Then
Me.txtSenateAandCDate.Enabled = False
Else
Me.txtSenateAandCDate.Enabled = True
End If
End Sub
But I also need it to disable the field is equal to "BA" or "BT" as well, how would I add that to my code?
View 3 Replies
View Related
Dec 15, 2006
I would like to change the property of a text box to Visible and Required when a user chooses a specific value in a drop down box of a different text box. Is this possible using a macro or some other way?
Thank you,
Deana
View 1 Replies
View Related
Dec 4, 2014
I have a list of all previous employers for a job applicant. I can enter up to 10 but I only want the boxes to show if there is a previous position for that box. So, if there are 3 previous positions, I want to see 3 lines. If there are 10, I want to see 10. I have fields [Company_1]. [Company_2], etc. I only want company 2 to show if the person has 2 previous positions entered into the form.
View 1 Replies
View Related
Sep 5, 2013
I have a report that is looking up min and max quality specifications for a product. The table with the specifications has a Yes/No check box field for when the specs are defined as "Internal". So the table looks like Product/MinValue/MaxValue/Internal
I want the report to display "TEST AND RECORD" when the Internal box is checked where the MinValue and MaxValue (that are stored in the table) would be displayed otherwise.
View 3 Replies
View Related
Jul 23, 2015
I have a query with a Date field for EndDate (the dates for end-of-week, Fridays in our case) and another field for Sales (number of sales, not dollars).I want to add 4 calculated fields that represent weeks and have the Sales appear in the correct column (field) for that date.So I will have columns for 10 July 15, 17 July 15, 24 July 15 and 31 July 15 and I want the Sales for each record to land in the correct date column, based on the EndDate column. (The 4 fields is just for the sake of the example, I will actually be having dozens of these calculated date fields).I tried to do it by setting up the 4 calculated fields like:
10Jul15: Sales
and then adding Criteria like:
EndDate = #10/07/2015#
It doesnt work.
View 3 Replies
View Related
Dec 30, 2012
I'm trying to calculate a value for a field based on the value of another field, [Field1] has a value list of 28 choices I want [Field3] to take that value and multiply it by the value of [Field2]. I'm using an Iif statement and it sort of works. I looks like this:
IIf([Field1]=1 Or 2 Or 3 Or 4 Or 11 Or 12 Or 13 Or 21 Or 22 Or 28,[Field2]*0.06,IIf([Field1]=5 Or 6 Or 14 Or 15 Or 23 Or 24 Or 29,[Field2]*1.1,[Field2]*2.1))
I receive nor errors but it will only return the value of [Field2]*.06 no matter what is selected in [Field1].
I'm sure I'm missing something and there is probably an easier syntax to use, but I'm at a loss at the moment.
View 4 Replies
View Related
Oct 2, 2013
I have a report that has multiple fields - 3 of which matter for this discussion -
1.) employee
2.) employer
3.) rateofpay
The employer field contains 1 of 2 options. For the sake of this conversation, lets call it ABC123 and XYZ123
I need to be able to calculate the average rate of pay for ABC123 company, and exclude the rate of pay for XYZ123 company in my report.
I am calculating this in a section footer.
View 2 Replies
View Related