Create A Field Value From A Another Field With Many Values...help!
Jan 5, 2006
I really need some help with this! I have a table with a field called [days.out]. It contains values from 1 to about 350, non sequencial with duplicates. I would like to run a query that would create a new field called [days.grouped]. This field would contain the word "1-15" if the value was between 1 and 15 in field [days.out] and "15-30" if value was between 15 and 30 in field [days.out], etc....
Hope someone can help me!!
View Replies
ADVERTISEMENT
Oct 25, 2012
How can I use different fields values to compose a paragraph? I want to make a shipment notification letter using different fields. For Example,
Hi [ShipToName],
Your order of book [BookName] has been shipped via [Shipping_Service]. The tracking No. is [TrackingNumber].
Your order has been shipped to following address,
[ShipToName]
[Street1]
[Street2]
[City], [State] [ZIP],
[Country]
Then I also want to email it using outlook 2010 but that might be a different thread.
View 12 Replies
View Related
Nov 28, 2014
I have two Tables, Table A and Table B...Table A and B have a one to many relationship with A (one) and B (many).I have a Master form that displays information for Table A. Also, I have a subform within this Master that displays information for Table B.
As I scroll through the records of A, you can see the 1-many relationship elucidated in the subform with many being displayed for Table B.I run into a dilemma, though, when I try to ADD a new record to Table A (and in turn Table B).When I add a new record, there is no Primary Key left to be displayed since this primary key is generated from a query.Hence, when I move to a new record, I can not save the record because there is no primary key. Since there is no primary key, there is nothing that i can input into the subform either. I want to create the primary key from values entered in the field. However, i CAN NOT create a relationship with an expression for field values.
View 1 Replies
View Related
Sep 20, 2013
I have a table - (Table A) that has 2 fields X and Y. I would like to write a query or script to make two new tables based on the unique values found in field X. In other words, all data where field X = 1 would be written to a new table called "1" and all data wehre field X =2 would be written to a new table called "2".I would like this done automatically.
Table A
Field X Field Y
1 a
1 b
1 c
1 d
2 a
2 b
2 c
View 5 Replies
View Related
Sep 11, 2012
create an expression in the Validation section to prevent duplicate entries in a field. Please view Powerpoint file on slide 1 on attachment for More detail instructions. Instructions are in simple Text and images which makes it easy to understand. I am using Access 2003.
View 14 Replies
View Related
Jun 18, 2015
I want Access to automatically generate a reference number for a record based on the values in on two other fields for a given record using a form.
The first field is called Operation Number.
The second is Bag Number.
The reference number needs to be in this format: 19C.3.1
Where 19C is the Operation Number, 3 is the bag number, and 1 is automatically generated. Additionally I need the last number --the automatically generated one--to go back to 1 if with each new bag number.
This is kind of like library catalog numbers. Not sure how to do this.
View 2 Replies
View Related
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
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
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
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
Apr 7, 2015
I have several fields that I fill in on a form and they all need to add up in the last field. The first way that I tried this worked good for the initial data entry on the form. However if I need to edit one of the fields in the form then it resets the TotalCost field and I have to enter all of the numbers again. Is there some way that I can make this work? Or is this an Access quirk I will have to live with?
I tried to do this two different ways.
Here is the code for the first method:
Option Compare Database
Dim C1 As Long 'For Total Cost
Dim C2 As Long 'For Total Cost
Dim C3 As Long 'For Total Cost
Dim C4 As Long 'For Total Cost
[Code] .....
This way works great the first time that I tried it, I had to re-enter info in all the fields if I wanted to change one.
Here is my second method:
Which didn't work, i received an error message:
"The expression After Update you entered as the event property setting produced the following error: Invalid outside procedure."
And then nothing changes.
Code:
Option Compare Database
Dim C1 As Long 'For Total Cost
Dim C2 As Long 'For Total Cost
Dim C3 As Long 'For Total Cost
Dim C4 As Long 'For Total Cost
[Code] ....
So I know this second method is incorrect.
View 3 Replies
View Related
Nov 18, 2014
I am trying to create a list of values in a field separated by commas. I have done this in a query as follows:
[Field1]&", "&[Field2]&", "&[Field3] and so on.
However, when Field2 is null, the result is two commas between Field1 and Field2, but I only need one. What function can I use to eliminate the extra commas when fields used in the concatenation are null?
View 10 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
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 14 Replies
View Related
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
Nov 16, 2007
I think the title pretty much sums it up....
I have a query where data is first sorted by user input; first field's criteria: [fieldname], then by another field's criteria: Is Null.
I know there are records containing null values in the second field, as I have run a select query with the criteria: Like "*", to make sure they are null, and not zero-length-strings.
The query is refusing to return any results...
Any ideas?
View 10 Replies
View Related
Aug 21, 2006
I would like to create an Expire Indicator field. This field would automatically check against today's date and if the Expiration_Date equals to TODAY, the indicator would automatically be set to YES.
Does anyone know how to create this field in the table?
Thanks in advance!
View 4 Replies
View Related
Dec 20, 2005
All,
I have trawled boards and sites, but cannot find the answer!
I have a make-table query, and I wish to create an AutoNumber field.
Now I know that if you put fieldname: "" , a Text field will be created and if enter fieldname: [] then a Binary field will be created.
Is there a code I can use to create an AutoNumber field?
Help appreciated!
Regards,
Jempie
View 5 Replies
View Related
Dec 21, 2005
I have an extremely large database which is in a continuous form format, and what I would like to happen is, instead of using the find button that would just find a word, I would like to have a pop-up search box that would yield actual texts throughout the DB (something like the search feature in Adobe Acrobat). In addition, I would like to use the "and" or "plus" together to search for additional data if needed. Please, unless there is a sample I could download and use in my db, please be specific in your instructions since I am new to all this.
Thanks!!
View 1 Replies
View Related
Aug 20, 2004
I have a table in an Access 2000 database: [SAP_Survey_Answers] that contains FieldNames: CO_ID, ES_ID,
PKey, QFieldName, QAnswer. The *_ID are ID#, QFieldName lists the questions in a survey, & QAnswer corresponds to the QFieldName and gives the answer given by the customer. Here's the dilema: I need to create a new table with CO_ID, ES_ID as Field Names BUT I also need each question as a new field name. How can this be done? Query? SQL statement? I've been racking my brain on this one. Any help would be greatly appreciated!
View 3 Replies
View Related
Jul 18, 2005
I need to show two decimal places on a form based on a recordset of a table that has a field - type = double, format = fixed, and decimal number = 2
I need to show 101.00 and 102.00 so if user insert a record, record would have a sequence id of 101.05.
How do I create that field by code? The table is part of a system loop that it changes everytime thats why I have to recreate the table again and again.
I can do the double, I cant do the fixed and decimal number.
Please please help.
Thanks.
NEVER MIND, I FIGURED IT OUT.
Instead of including it with the code, I tweaked how the form displays it.
Thanks.
View 1 Replies
View Related
Nov 3, 2004
I have a database that I took over for a small group (it has about 400 records), and they want to add a field for "Member ID", to use for member badges and whatnot.
A friend tried to help me by suggesting the "Change the starting value of an incrementing AutoNumber field" from the Access Help File, but I don't necessarily want incremental numbers, I just want a string of perhaps 8 numbers in no particular order, and obviously, unique to each record. I also don't understand how I can get that to work in pre-existing records...
So, what I'm wanting, in a snapshot, is:
83928475 John Smith 123 Any St
93827221 Mary Jones 678 Market St
19182734 Elvis Presley Graceland
etc...
I was thinking that perhaps a formula could be created in a query? Heck I don't know!
I only know enough about Access to be dangerous, so I appreciate anyone's help!
THANKS!
Matt
View 4 Replies
View Related
Dec 4, 2004
Hi,
I'm new to this forum and have a question:
I want to create a table with an Autonumber field using a SQL statement,
in Microsoft Access Database, something like this:
Cnn.execute "CREATE TABLE newtable (id Long, Name Char(100)) "
is there something to put in place of "long" to make the field autonumber?
I tried the word "autonumber", but did not work.
Many Thanx.
Hadi.
View 3 Replies
View Related
Jan 28, 2014
I am trying to , create a field using the IIf function that will display a $250 bonus for agents every time they sell a car for at least $20,000. Otherwise, the function will return a 0. Name the field Bonus. I put in Bonus: IIf(SalePrice >= "20,000" Then + "250",True, 0) and it is saying that I have an improper syntax.
View 2 Replies
View Related
Nov 12, 2012
I have a table as followed;
EmployeeID: PK
FirstName
MInitial
LastName
Company:FK
Department:FK
What I want to do is create a new field that automatically populates based on what is entered into the above fields.
Essentially creating a single field with unique data generated by multiple fields.
For Example if I entered the following informaiton:
EmployeeID: 1 (AutoNumber)
FirstName: John
MInitial: P
LastName: Doe
Company: FederalGov
Department:Test
The new field can be generated as followed: JohnPDoeFederalgovTest
What i plan on doing with this is making this "generated" field an index so no new duplicated records can be added.
View 5 Replies
View Related
Sep 12, 2013
I created a database of "My Cars", "Television", and "Wines" and a Trouble Reports(TR) for each. I have a field TR on each and for now a user can fill it up with number i.e first TR is 1, second Tr is 2 etc etc. I want it automatically filled automatically not manually. However, I want it to do the same for "Television" and "Wines" when I write Trs on them. I am a rookie and I dont know how to do it I attached a copy of the db I created.
View 2 Replies
View Related