Adding Iif To Query Or Table
Mar 15, 2006
Hello folks first post here. I tried reading through the boards to find someone with a similiar question, but not luck yet. I have been working with a basics of Access for about a year. I did take take a bit of programming in college but I don't remember much of it, so I looking for a little help. I can usually Google for answers but I cannot seem to find the write key words this time.
A while back I created a table that tracks employees' data and recently I started working with the insurance data I have gathering for sometime.
It goes something like
Field Name Data Type
SS# Number (primary key)
Insurance $ Number
PPO YES/NO
HMO YES/NO
Self YES/NO
Spouse YESNO
Children YES/NO
Family YES/NO
Dental Self YES/NO
Dental Spouse.......etc.
What I'm trying to do is turn the yes/no's into total dollars for each person. I have done this in Excel but the fields were differnet and I had to use a many, many if.'s or a lookup table(data array)
PPO doesn't = a dollar amount by itself, but PPO + Self = $19.03 or PPO + Self + Dental Self = $23.00. Or the person can just have Dental Spouse = 8.86. Pretty much the people can take a piece and leave another.
"Insurance $" is another field name and is where I am trying to get the total to go.
I was thinking of a lookup table but I don't know how to do that in outside of Excel.
I am thankful for any help or even a nudge in the right direction.
~Profector
View Replies
ADVERTISEMENT
Nov 23, 2005
Hi All,
I am trying to add the infomation from a query and place it in a table so that I can use that data to build a Union Query that plots onto a chart.
Heres what I have:
Dim qDef As DAO.QueryDef
Dim SQL As String
Set qDef = CurrentDb.QueryDefs("QryBaseline")
SELECT tblAudio.AudioID, tblAudio.PatientID, tblAudio.AudioDate, tblAudio.Type, tblAudio.L500, tblAudio.L1k, tblAudio.L2K, tblAudio.L3K, tblAudio.L4K, tblAudio.L6K, tblAudio.L8K, tblAudio.R500, tblAudio.R1k, tblAudio.R2K, tblAudio.R3K, tblAudio.R4K, tblAudio.R6K, tblAudio.R8K
FROM tblAudio
GROUP BY tblAudio.AudioID, tblAudio.PatientID, tblAudio.AudioDate, tblAudio.Type, tblAudio.L500, tblAudio.L1k, tblAudio.L2K, tblAudio.L3K, tblAudio.L4K, tblAudio.L6K, tblAudio.L8K, tblAudio.R500, tblAudio.R1k, tblAudio.R2K, tblAudio.R3K, tblAudio.R4K, tblAudio.R6K, tblAudio.R8K
HAVING (((tblAudio.Type)="BL")) AND (((tblAudio.PatientID)=[Me]![PaiteintID]));
I have a "tblEvaluate" that I want to store the above selected record.
I am not sure whether to add and Delete, OR Edit and Update?
How do I get the above information into the table - "tblEvaluate"?
I know it's simple, I just have a mental block!
Thanks for you help....ENVIVA
View 3 Replies
View Related
Apr 4, 2005
My form is based on a select query. There are 2 combos that filter the data displayed in the form by status and property. All of the data is contained in the same table and the query is looking at just the one table. Clicking a button opens a listbox that contains all of the filtered data and clicking a record in the listbox populates the form with that record and closes the listbox. It works good like this.
When I try to add one field (labor) from a second table to the query with that same field added to my form, as long as there is a value in the labor field in the table then it works. If there is no value for labor then the form returns no records. There are records there but they do not have labor assigned yet. I set a default value for the field on my form - (not assigned yet). The listbox displays the records even though there is nothing in the labor field, but clicking a record in the listbox returns an error of 'no current record'.
Actually I dont even have to add the labor field to the form, just having it in the query mucks up the form. I must need an isnotnull statement in the criteria or something.......
Any ideas what I may be doing wrong?
Thanks!
View 6 Replies
View Related
Dec 27, 2005
I have a make table query created from a linked to a table. i want to add field to the make table query that are not fields on the table. How do i insert a created field? Hopefully this is a basic question.....
View 1 Replies
View Related
Oct 4, 2007
If I have a make table query where I want to add in some blank fields, say: Field1: “” , Field2: “”, etc…. is there a way I can make these fields a yes/no type instead of the default text?
I know I can manually go into the table in design view after I run the query, but I was hoping I could do it beforehand. :)
Thanks!
View 1 Replies
View Related
Mar 14, 2008
I've got a fields called rev code that contain the following values:
field name: 110 131 250 255 258
field value: 7.49 6 11.25 12.11 78
I'm writing a query that pulls from the first two digits of the rev code and need to round off to the nearest dollar so in my query I'll have a column 11 with a value of 7, a column 13 with a value of 6, then I need to take columns 250 255 and 255 add the values together and round off so I get a column 25 with a value of 101.
How do I do that?
View 14 Replies
View Related
Feb 12, 2014
I have a query which looks up records from a table, now what I would like to do is append the word All Projects to this query - is it possible, and if so how?
View 7 Replies
View Related
Aug 16, 2013
I have a form with sub-forms. All the subforms work smoothly, I am able to assign students to classes, enter their late/absence data etc... But there's 1 subform that I want to include the Gender (male,female) so I have to go back to the query (see attached picture) to include the table with gender data and map it with other tables, then insert a combo box in that subform, which display the gender of the student along side with other data.
But the problem is as soon as I modify the query for that subform, all the subforms (including that one) stop working, I'm not able to enter and change anything with error like Recordset is Noteditable ( see attached screenshot).
And after I remove that table from the query and the combo box from the subform every works just fine again.
View 3 Replies
View Related
Aug 28, 2013
I'd like to know how to add a blank filed (memo), called "comments" that is not pulled in from any existing table, in an existing maketable query which is getting it's fields from different linked tables , so that the destination table that comes out of this query, has all those data along with an extra column for me to add comments.
View 5 Replies
View Related
May 31, 2014
The VBA code I have at the moment:
me.Results.Rowsource = "SELECT car, title, FROM dbo_inventory"
Is it possible to add a variable to a specific row in listbox using the code above? In this case the price?
View 3 Replies
View Related
Mar 20, 2013
I'm using Access 2003...I have a query that searches a parts table by description:
Like "*" & [Enter in Part Description to search] & "*"
I need to add another search to this query, I added another field to the parts table call manufacturer. I add this field to the above query and added this parameter to it:
Like [Enter in Manufacturer] & "*"
I then added a manufacturer to one of the fields for test purposes. For some odd reason this doesn't work. If I take out the manufacturer parameter and don't enter in anything into the part description the query returns all the records. When i type a description into the part description field the query returns the proper records. When I add back the manufacturer parameter and enter through both parameters only the one record returns showing the test record instead of all of them. If I put a part description in and enter through the manufacturer parameter no records show when they should.
I've tried adding a test field to a different table and tried a different query using the like parameter. The parameter works in a field already in the table but won't work with the new field I added. I've done compact and repair.
View 6 Replies
View Related
Oct 24, 2014
I have a invoice system I have created in Access and it did used to work perfectly and then maybe an update Who knows stopped the system working.
I have an customer order screen that has customer details and then a subform within the same form this takes a total of items & costs for this order and then it entered it into the customers table from the order_Details table using me.Order_total = Order_Total.
I know this is bad design but I store it because once the order is places I need the total to be static because the invoice has been sent and so if someone changes the order then the total owed doesn't change.
I then have a reconcile form which is on a datasheet form straight from the tab;e so it is editable which has a checkbox that then once ticked copies the total from the Order_Total in the table to the reconciled field in the same table and then I use a report to show who owes me still.
So I have made a Select query from the Orders table & Order_Details table and used a Group by Order number (Which is the link between the 2 tables) this shows correctly but now not editable because of the rules So I am trying to add an editable checkbox on the same form.
I tried to use a dlookup makes all of the boxes either ticked or not. I've been looking at Recordsets but I'm unsure if this is what I need or not really
So really I just need to see if I should be putting the Total from the Subform into the mainform and then entering it into the table (Like previously) using a calculated unbound field and then using the Afterupdate event to insert the data into the table. but for some reason it just wont work.
I can get the OnClick to work but then as soon as i go to the next record for some reason it then resorts to 0.00 but then the table shows correctly which ever record the form is working on.
Or should I be using the new query based idea to create the reconcile form and if this is the best way I just don't now where to start on how to get a multiple table query that I can then add a reconciled checkbox which then copies the Order_Total from the table to the Paymet_Recieved field.
View 13 Replies
View Related
Aug 19, 2015
I'm developing a database for the hospital I work in. One purpose of this is to keep track of patients with temporary invasive devices (there are many types such as urinary catheters, ventilators, etc.), specifically how many days each patient has a device for. Each device is associated with one patient only, but one patient may have many devices. Here's how the associated tables are set up:
1. tblPatients - PatientID (PK), LastName, FirstName, DOB,...
2. tblLocations - LocationID (PK), LocationLabel,....
3. tblDevices - DeviceID (PK), DeviceType, Device, DeviceDesc
4. tblDeviceUse - DeviceUseID (PK), DeviceID (FK), PatientID (FK), LocationID (FK) (where in the hospital was device inserted, e.g., operating room, bedside, etc.), DeviceStartDate, DeviceEndDate
5. tblDeviceDailyLog - DeviceLogID (PK), DeviceUseID (FK), DeviceDate, PatientLocID (FK) (area in the hospital that patient is in)
All primary keys except for PatientID & LocationID are Autonumbers; and the tables are linked appropriately.
Whenever an entry is made into tblDeviceUse, I want there to be new records to be automatically generated in tblDeviceDailyLog for each date between the Start and End Dates. For example, patient A123 had a urinary catheter from 1/1/2000 to 1/10/2000 that was inserted while the patient was in the ICU, but the patient was moved to the Medical Ward on 1/7/2000. So tblDeviceDailyLog should have 10 new records associated with this device, one for each calendar day, with the appropriate location for each day.
View 3 Replies
View Related
Sep 19, 2013
I'd like to learn how to do them quickly and effectively in Access. One of those things seems like it would be an incredibly simple, intuitive operation, but it's not, at least not to me.Say I have some data that really should only be on one table, but it's currently on two tables in Access: "List Main" and "List September Adds." They both have the following fields: "Full Name" "Email" "Address" "City" "State" "ZIP" "Phone."
The first table is my main list of contacts. The second contains new info, consisting of 1. a few new contacts, and 2. updated info for a few of the contacts already in table "List Main."
I would simply like to put all the new contacts from "List September Adds" into my "List Main" table, and I'd also like to fill in a few missing e-mails in "List Main" with newly gathered e-mails for those contacts, info that is in my table "List September Adds."I'm sure there is built-in functionality to do something as basic as essentially turning two pages of the same spreadsheet into one. In fact, I know I could import data from an Excel file and have it "append" to a preexisting table if the fields are all the same.
However, I'd like to know how to do it when the tables are already in Access (without having to learn any SQL, mostly because I'm fairly certain I don't need to know SQL to do something like this). I've heard of Append and Update Queries and given their names, it sounds like they'd be useful, maybe with use of "Totals" and "Group By" to get rid of duplicates; however, I can't seem to get any of this to work right.
Mostly, when I think I am doing an Append correctly, it doesn't add new data at the bottom of a table; it just wipes out all the data that was there, and replaces it with data from the source. For instance, when I've been running an Append Query to get my "List September Adds" rows into my "Main List" table, what I end up with is only the "List September Adds" rows, and all the "Main List" rows gone.
View 7 Replies
View Related
Jun 22, 2012
I have two tables they both share column 'Mile Markers'. Table 1 lists all mile marker from 0-60 in 0.1 mile increments, in order. It also has a column for x and y coordinates. Table two only lists 435 random mile markers. Is there a way to add the correct coordinates to the 435 mile markers in table 2 from table 1?
View 5 Replies
View Related
Oct 2, 2005
The attachment is the database Im working on and I have a problem.
I need to add a supplier Product number in there some where so I could keep the numbe as reference and so it may be easier to enter items recieved.
in the form section, I will have Invoice with a sub form Invoice details.
I need to put suppliers Item number somehow so it would search and if the item is on the product list it would fill out the rest of the values.
should I make a separate table for suppliers product number or should I just include that into the invoice detail? I dont want to put it in the product table since I get same Items from different suppliers.
View 1 Replies
View Related
Jun 26, 2006
I have a table with a bunch of values for time spent on a variety of projects. Each persons time on a project is entered using a form. What I'd like is to then be able to add some of these times to get a total department time and a total project time in the table to help with our project costs estimating. Anyone have any ideas as there doesn't seem to be an easy way in the table itself to merely add columns. Thanks in Advance.
View 4 Replies
View Related
Nov 4, 2004
I have been writing a stock control database for my small Jewellery Shop and thanks to all the help and encouragement I have received here can see the light at the end of the tunnel - until I reaised a major design error!
My system is based around every product having a unique Product Code in the form ABC1234
AB is a 2 letter code for the Supplier
C is the category (Ring, Bracelet, Pendant etc)
1234 starts at 1 and gets incremented by 1 for each different product
The problem is that I have no current way of recording different sizes for rings with the same Product Code. So when I run a stock level check I may have 3 rings with the code JWR0021 and if my reorder level is set to 2 I would not reorder any of them. The ring may be a top seller in larger sizes but nobody buys them in the smaller sizes, I am sure you can see my problem.
What I want to do is to add another table for ring sizes but still keep the same Product Code. That way I can keep the code as ABC1234 but have A,B,C etc as subset of data for sizes.
What would be my best way of doing this without having to re write everything?
As usual any suggestions will be most welcome.
View 8 Replies
View Related
Feb 9, 2005
Hope someone can help!
I was wondering if is possible to add a series of records that are in serquence to a table by just entering the first and last numbers. For example a string of numbers starting at TP11000 and ending at TP11100, the prefix TP doesn't change. Currently I have to enter every one manually, so any help would be much appreciated!
View 4 Replies
View Related
Feb 6, 2006
I have 2 fields in a table 1. called CommAmtDue and the other called CommAmtPd, When the user inputs a value in the CommAmtPd I want the CommAmtDue - CommAmtPd = CommAmtBal
I want this value to be stored in another field in the same table called CommAmtBal
I can do the formula in a query but how can I get the value to be stored in the field to user for later.
Thanks
View 14 Replies
View Related
Mar 15, 2006
Hello folks first post here. I tried reading through the boards to find someone with a similiar question, but not luck yet. I have been working with a basics of Access for about a year. I did take take a bit of programming in college but I don't remember much of it, so I looking for a little help. I can usually Google for answers but I cannot seem to find the write key words this time.
A while back I created a table that tracks employees' data and recently I started working with the insurance data I have gathering for sometime.
It goes something like
Field Name Data Type
SS# Number (primary key)
Insurance $ Number
PPO YES/NO
HMO YES/NO
Self YES/NO
Spouse YESNO
Children YES/NO
Family YES/NO
Dental Self YES/NO
Dental Spouse.......etc.
What I'm trying to do is turn the yes/no's into total dollars for each person. I have done this in Excel but the fields were differnet and I had to use a many, many if.'s or a lookup table(data array)
PPO doesn't = a dollar amount by itself, but PPO + Self = $19.03 or PPO + Self + Dental Self = $23.00. Or the person can just have Dental Spouse = 8.86. Pretty much the people can take a piece and leave another.
"Insurance $" is another field name and is where I am trying to get the total to go.
I was thinking of a lookup table but I don't know how to do that in outside of Excel.
I am thankful for any help or even a nudge in the right direction.
~Profector
View 6 Replies
View Related
May 27, 2006
I have a table to which items must be added and others must be removed. Items in the table must be numbered consecutively At present I switch from the table to a query and manually reset the reqirements in the criteria section for each alteration. Can I set up a Query, Update query or something similar so the when I add or delete an Item the numbers field automatically renumbers the rest of the field. If this is understood. Thanks to anyone who can help.
View 6 Replies
View Related
Jan 17, 2006
Hello all,
i am making a form to process ordering within my membership system,
i would like to add what i believe is called a subform or table of somesort, which is all connected to the same table i am using, but i would like it to appear in hte table format so that i can add more than one product that my client is buying.
the attachment i have shows what i have so far, the product information on the left is what i would like to be in the table area.
View 2 Replies
View Related
Mar 20, 2008
This is going to sound like a bizarre question, but, here it goes. Is there a way to add more than 255 fields to a table? Or is 255 the cutoff? Also, if you have two table with different information on one client, is there a way to add a client to one table and have it automatically add it to the second? Sorry about all of the wierd questions. Let me know if you know anything.
View 3 Replies
View Related
Dec 21, 2005
Hello
I have created an DB which we report the errors on a system we use. We would like to add images into the table where we record the problem so the programmers can see whats going wrong.
I have created a field within the table called images with a OLE Object selected. When i go to add an image i get an error message "OLE Server was lost, or the OLE server encountered an error"
Is this a problem with Access or would this be a problem with our network?
View 2 Replies
View Related
Sep 18, 2006
hi
I had a form with TO,DATE,BODY and a button .
on click of a button this fileds should get added to a table.
I have created a table with same fields.
Thanxx
View 1 Replies
View Related