Update/amend Querie Woes!

Mar 23, 2007

Hello,

I have a table exported from excel. I intially imported this in to access to form a list of due dates for services.

Every week I get and e mail with the updated version.

I am trying to figure out how to update the dates in the 1st table with the new weekly ones.

I can't get it to update. Also there may be the addition of new services as well.

Any tips would be grealty recieved.

Many thanks in advance.

View Replies


ADVERTISEMENT

Modules & VBA :: Update And Amend Records In A Table - Error Trying To Execute SQL Statement

Jun 18, 2013

I'm trying to create a function to update and amend records in a table.

The update part works and updates existing records with new data but I'm getting an error with the insert part.

Run time error 3078
The Microsoft Office Access database engine cannot find the input table or query 'FALSE'. Make sure it exists and that its name is spelled correctly.

Nothing called 'FALSE' so not sure what that means?

Code:

sSQL = "INSERT INTO Pupil_tb (PupilID,Class,PupilName,etc ) " _
= "SELECT PupilImport_tb.PupilID, Class, PupilName, etc FROM PupilImport_tb " _
& "LEFT JOIN Pupil_tb " _
& "ON Pupil_tb.PupilID=PupilImport_tb.PupilID " _
& "WHERE Pupil_tb.PupilID Is Null "

CurrentDb.Execute sSQL, dbFailOnError

View 5 Replies View Related

Amend The TOP Value

Nov 6, 2006

Is it possible to set the "TOP" value of a query, via an unbound text box from a form ?

i.e. SELECT TOP "this number will be from a value in a text box" ...

Thanks

View 3 Replies View Related

Can You Amend MSysObjects

Feb 23, 2006

Well, the title says it all.

Is it possible to amend this hidden table? It is for my ODBC links, I would like to amend (enmass) where it is linked to and the table name. If I could amend this table, it would only take seconds.

View 1 Replies View Related

Amend Top Value Via Text Or Combo Box

Jan 23, 2007

Is there a way whereby I, or another user, can amend the ‘TOP’ value of a query via a Combo or Text box entry on a form? I have searched this Forum for a solution to this very problem but have had no success. I understand how to achieve this via the queries ‘SQL’ view but cant figure out a way to do it by the way that I have already described!!

Your advice or a ‘pointer’ in the right direction would be extremely well received.

Thanks for your time.

Have a nice day...

Kind Regards

CarolW

View 2 Replies View Related

Need To Have Query Amend A Revised Calculation

May 30, 2006

I have a query which calculates and original amount, looks to see if there is an increase or a decrease in the amount, and if it's an increase, it adds the original amount to the amount of the increase, and gives a "revised" amount. If it's a decrease, it subracts the original amount from the amount of the decrease, and gives a "revised" amount as well. This works fine for the line item, as long as there's only one Revision to the line item.

What I need it to do, and I'm not sure if I should still be doing this at a query stage, or if it should be coded, is, if there is more than one revision to the line item, it needs to look at the new "revised" amount (from the first revision), and then add the increase or subtract the decrease from the revised amount, and give a new "revised" amount, instead of taking it from the original amount.

example of what it's doing now.

Rev #1 Orginal line item - $4,300 Increase - $500 New Revised amount - $4,800
Rev #2 Original line item - $4,300 Increase - $50 New Revised amount - $4,350

What it should be doing.

Rev #1 Orginal line item - $4,300 Increase - $500 New Revised amount - $4,800
Rev #2 Revised Line item - $4,800 Increase - $50 New Revised amount - $4,850

I need to have it look to see if the revision # is higher than 1, and then look at the revised amount, and do the increase or decrease at that time, and then give another "revised" amount.

Is this doable? And if so, any help would be greatly appreciated!

:confused:

Here is the Expression that I have in my query to calculate my "revised" amount. It looks at the original amount, and looks to see if it's an increase, and if it is, it adds it to the revision amount, and gives a new total for the line item, otherwise it sees that it's a decrease, and it subtracts the revision amount from the original, and gives an new total.

New Amount: IIf(tblRevisions![Increase?]=True,[revision Amount]+[Line Item Amount],[Line Item Amount]-[Revision Amount])

View 4 Replies View Related

Modules & VBA :: Amend Data In Different Table

Jan 23, 2015

I have a form that has four text boxes populated by a combo selection on a prior form; on the form in question, these four text boxes are locked, however there is a command button to allow users to amend the information in these boxes - all works fine, however the changes they make are only applied to the current record. On occasion, it would be useful if these changes were able to be sent back to the source table to amend it.

Giving the option would be easy enough with a Yes/No message box, but is there a way with some code to amend the source record of the combo?

View 5 Replies View Related

Queries :: Amend SQL For Find Duplicates Query

Oct 23, 2014

I have a find duplicates query with the following SQL:

Code:
SELECT tblData.Vendor, tblData.[Loccurramount EUE], tblData.Last4, tblData.ID, tblData.Line, tblData.CoCd, tblData.[Document record number], tblData.PurchDoc, tblData.Reference, tblData.Curr, tblData.[Entry dte], tblData.Status, tblData.Version, tblData.Outcome
FROM tblData
WHERE (((tblData.Vendor) In (SELECT [Vendor] FROM [tblData] As Tmp GROUP BY [Vendor],[Loccurramount EUE],[Last4] HAVING Count(*)>1 And [Loccurramount EUE] = [tblData].[Loccurramount EUE] And [Last4] = [tblData].[Last4])))
ORDER BY tblData.Vendor, tblData.[Loccurramount EUE], tblData.Last4;

This works fine however I want to add another clause to the WHERE and I'm not sure how. At the moment the query highlights duplicates where the Vendor, Loccurramount EUE and Last4 match. I want to further restrict it so that it only finds duplicates where the Vendor, Loccurramount EUE and Last4 match BUT the number shown in version Does Not Match

So if two records have the same details for Vendor, Loccurramount EUE and Last4 and also have the same Version number then they don't show in the result.

View 3 Replies View Related

Modules & VBA :: Amend Coded Command Buttons Using Code?

Dec 10, 2013

I want to be able to change certain parts of a Query and Code based on the contets of a text box.

Example with Command Button Code:

Textbox contains the name Tom

This is a command button on a form that i have copied and renamed etc through VBA to Tom (contents in the textbox)

DoCmd.RunCommand acCmdSaveRecord
DoCmd.SetWarnings (False)
DoCmd.OpenQuery "Qry BM to Management", acViewNormal
DoCmd.SetWarnings (True)
DoCmd.GoToRecord , , acNext

I now want to change where it says "Qry BM to Management" to "Qry Tom to Management",

Example with Command Query:

Again Textbox Contains Tom

Query has been copied but now i want to change the following SQL string from where it says Bhavins Table to Toms Table

INSERT INTO [Management Table] (Postcode)
SELECT [Bhavins Table].Postcode
FROM [Bhavins Table];

Im not sure if this is possible but i would like to know as adding a new user to my Database takes me about 10-15 minutes but I know what im doing (copy paste change specific parts of Queires and points of forms etc ) but i need to make it easy for management to add new Users....

View 2 Replies View Related

Relationship Woes

Apr 20, 2005

The database for workers works ok from a solitary table, tblEmployees.

I want to make it a relational db.

I’ve incorporated lookup tables. But I’m lost about what to do next – and if it should be divided further.

I’ve studied many tutorials in relationships, but I don’t find one that resembles this one.

Could a relationship expert give advice please? I've included a sample, hoping this will be simplest way for you to understand the challenge.

View 14 Replies View Related

Alias Woes

Sep 25, 2007

so, I have created a working SQL statement that summarises data from a bunch of different tables (it's a stock monitoring application so it all has to do with levels of stock, numbers of parts processed etc...):

SELECT tblPPIn.BatchID,
tblPartDescriptions.DrawingNumber AS [Drawing Number],
tblOrder.IssueNumber AS [Issue Number],
tblPartDescriptions.Description AS [Description],
tblPPIn.Qty AS [Total Booked In],
IIf(IsNull((SELECT Sum(tblPPProcessed.QtyProcessed) AS SumOfQtyProcessed FROM tblPPProcessed WHERE tblPPProcessed.BatchID = tblPPIn.BatchID;)),'0',(SELECT Sum(tblPPProcessed.QtyProcessed) AS SumOfQtyProcessed FROM tblPPProcessed WHERE tblPPProcessed.BatchID = tblPPIn.BatchID;)) AS [Total Qty Processed],
IIf(IsNull((SELECT Sum(tblPPOut.Qty) As sumofQtyOutPass FROM tblPPOut WHERE tblPPOut.BatchID = tblPPIn.BatchID AND tblPPOut.IQCPass = 'PASS';)),'0',(SELECT Sum(tblPPOut.Qty) As sumofQtyOutPass FROM tblPPOut WHERE tblPPOut.BatchID = tblPPIn.BatchID AND tblPPOut.IQCPass = 'PASS';)) AS [Total Good Parts Taken],
IIf(IsNull((SELECT Sum(tblPPOut.Qty) As sumofQtyOutUninspected FROM tblPPOut WHERE tblPPOut.BatchID = tblPPIn.BatchID AND tblPPOut.IQCPass = 'UNINSPECTED';)),'0',(SELECT Sum(tblPPOut.Qty) As sumofQtyOutUninspected FROM tblPPOut WHERE tblPPOut.BatchID = tblPPIn.BatchID AND tblPPOut.IQCPass = 'UNINSPECTED';)) AS [Total Uninspected Parts Taken],
IIf(IsNull((SELECT Sum(tblPPProcessed.QtyPass) AS SumOfQtyPass FROM tblPPProcessed WHERE tblPPProcessed.BatchID = tblPPIn.BatchID;)),'0',(SELECT Sum(tblPPProcessed.QtyPass) AS SumOfQtyPass FROM tblPPProcessed WHERE tblPPProcessed.BatchID = tblPPIn.BatchID;)) AS [Total Passes],
IIf(IsNull((SELECT Sum(tblPPProcessed.QtyFailEtching) + Sum(tblPPProcessed.QtyFailCutOut) + Sum(tblPPProcessed.QtyFailFlatness) + Sum(tblPPProcessed.QtyFailHandling) + Sum(tblPPProcessed.QtyFailOther) AS SumofFails FROM tblPPProcessed WHERE tblPPProcessed.BatchID = tblPPIn.BatchID;)),'0',((SELECT Sum(tblPPProcessed.QtyFailEtching) + Sum(tblPPProcessed.QtyFailCutOut) + Sum(tblPPProcessed.QtyFailFlatness) + Sum(tblPPProcessed.QtyFailHandling) + Sum(tblPPProcessed.QtyFailOther) AS SumofFails FROM tblPPProcessed WHERE tblPPProcessed.BatchID = tblPPIn.BatchID;))) AS [Total Fails],
[Total Booked In]-[Total Qty Processed]-[Total Uninspected Parts Taken] AS [Total Unprocessed Parts Remaining],
[Total Passes]-[Total Good Parts Taken] AS [Total Good Parts Remaining],
[Total Passes]/[Total Qty Processed] AS [Overall Yield]
FROM tblPPIn INNER JOIN (tblPartDescriptions INNER JOIN tblOrder ON tblPartDescriptions.DrawingNumber = tblOrder.DrawingNumber) ON tblPPIn.BatchID = tblOrder.BatchID
ORDER BY tblPPIn.BatchID ASC;

don't worry about the details, it works as it is above...

now I only want to display data for batches where there are some parts left, so I've tried adding the following WHERE clause:

WHERE ([Total Good Parts Remaining] + [Total Unprocessed Parts Remaining]) <> 0

should work fine, right?
nope, we get the (all too familiar) 'Enter parameter value: Total Good Parts Remaining' (and the same for 'Total Unprocessed Parts Remaining'), despite the fact I have used these aliases in the previous SQL with no problem...

Is there any way around this or do I have to create a big-ass WHERE statement complete with the subqueries I've already used previously?

This is seriously annoying me today... any help would be massively appreciated!

cheers,
Bogzla

View 7 Replies View Related

Round Up Woes

Jan 22, 2008

Hi,

I am running a query that has this function

MyRoundedValue: Round([Bonus Total],2)

I am trying to round up the value in Bonus Total.

Currently the result shows 5140.602 and I want it to round up and show 5140.61

Is this possible? For the life of me I cannot figure it out..

Thanks

Fen How

View 1 Replies View Related

Sub Form Woes!

Mar 9, 2005

I have a subform on my main form which I can access properties etc without error, but when I try to set the sourceobject property I get an error saying it can find the object '~sq_cfrmAction~sq_csubPlanetItems'

My form is called frmAction

The subform is called subPlanetItems

The code that errors is this;

Me.subPlanetItems.SourceObject = "qryInPlanetNotInWIMS"

The query runs fine so it is not that?

Help please

View 2 Replies View Related

Username & Password Woes!

Jan 10, 2007

Hello!
I have a problem regarding using usernames and passwords to restrict access to certain tables/forms/reports etc....
I have read around the forum and various other websites but cant seem to get much relating to exactly what i am wanting to do.

I think i understand the way the access workgroup security works. But does this not just restrict users being able to view the database as read-only or with other certain rights like that? So, firstly would i be able to use this to restrict the database the way i want?

Or is there a way to create a table with names and passwords and create a form at the beginning where the user inputs their details and then according to the details gives/restricts access to parts of the database? Ideally i'd like the startup form to direct them to a different menu according to the user which gives them only the options they are allowed?

Seems a bit of a mouthfull and i sound like a complete newb but i been trying to figure this out all day!!
Thanks

View 2 Replies View Related

Importing From Excel Woes !!

Jan 11, 2007

Hi all,
I have been using Excel data in Access either by importing the sheet as a table or directly linking to the sheet with no problems in the past but today I cannot seem to get the data to import in the right way.

The column on the Excel sheet is mainly populated by numbers but some of the values have letters in them. When I discovered this I formatted the column as text and tried to directly link to the sheet but the datatype kept insisting it is number. I then decided to import the sheet as a table and although it comes in as Text instead of seeing the value A1030573 in comes in as 7.1e+009 and this goes for the values that are purely numbers.

Is this a known bug, does anyone have a solution to to this ?

Thanks in advance,
Mitch....

View 3 Replies View Related

Access Printing Woes.

Mar 19, 2007

Here's a weird problem I've had develop in the past couple months, before I upgraded to 2007, and now since I upgraded to 2007.

I've had the same Access database since 1997, and just recently upgraded it to Access2007, but as I said the problem occurred before and after the changeover.

I have two servers at the office. Server #1 (where the database is located) has attached to it is a dot matrix printer, used for printing our 4 part invoices/packing lists. I have another server (#2) which has a laser printer attached to it. The laser printer on server #2 is the default printer for all computers in the office. I have a lot of reports in Access where the printer to be used is the default printer. I have a single report in Access where I specified in the page design and layout to use a specific printer - the dot matrix on server #1.

Both servers are always on. Both printers are always on. I can go for weeks and weeks with no issues in printing the invoices. Then suddenly I'll get a

"This document was previously formatted for the printer (printer name) on (server #1), but that printer isn't available. Do you want use the default printer (\server#2laser printer) ?
OK CANCEL SETUP... HELP

It worked fine for 9+ years, and now I am getting this error. No new computers in the last 2 years. No new printer installs in the last 2 years.

I've gone through, uninstalled the printer, reinstalled the printer, both on the server and remote machines, and now I can't even get the report to "remember" that I want it to always print to the dot printer.

Any ideas?

View 1 Replies View Related

Duplicate Entry Woes

May 30, 2005

I have a table that has (to simplify things) two fields.

[Patient_No] [ID]
BA4206 1067404
BA4206 1067405
BG1013 1067545
BG1013 1067546
BG1013 1067547
BG1111 1078432

I want to be able to count the number entries where the Patient_No is the same and output the query like this:

[Patient_No] [ID] [COUNT]
BA4206 1067404 1
BA4206 1067405 2
BG1013 1067545 1
BG1013 1067546 2
BG1013 1067547 3
BG1111 1078432 1


Hopefully this is just a simple query but for some reason i cannot get it to work.

Any help is much appreciated.

Thanks in advance

View 7 Replies View Related

Record Saving Woes

Mar 16, 2006

Ok, here is my scenario.

I have several FE's each saving in their own BE. They are all the same but for different areas of our business. Each has around 20-30 users. I recently introduced another form into the FE that has linked tables to another different BE in another folder. Each FE out there with its own BE now has this form and all of the new forms save to the same (one) BE. Ok, got it?

Now, sure its possible to have them all together and I would anticipate someone suggesting this. Its split up to keep sizes down and performance up among other reasons.

In any event, here I am. All of the new form introductions went smoothly without a hitch. The last one however is causing trouble. On submit an e-mail is sent, the user is asked if they want to submit another form, and if yes a new record is created. If no the form is closed.

E-mails are always sent, no problem. The trouble is saving the record. All except one of the different FE's I have out there in different folders save the record into the table just fine. There is one though that does not do this. The mail is sent and the program behaves normally with no errors but the record is not saved. This does not happen to all users of this FE either. There are some users that work fine and the record is saved in the BE yet other users do not save the record. You can see the .ldb appear and disappear. Our IT dept has been through the permissions time and time again and tell me they are ok. The FE and main BE are in one folder while the BE that the new form talks to is in its own folder. Remember, this works fine for several other instances, its just the one that doesn’t save the record.

I did have a chance to see the permissions the other day and it seems a mess to me. They have users in individually, as they were set up initially and the same users are also in there in a group and maybe 2 groups. The permissions look a mess to me… they really do…. but that doesn’t necessarily mean they would not work and can be blamed. I have no control over this part and it drives me nuts!

What I have done...... copied a working FE from another area into the troubled folder. No good. I have removed the new form along with its linked tables and the record is saved. Put the form and linked tables back in and it stops saving again. The code compiles just fine. I have done compact and repairs.

Any thoughts or ideas out there??? If you need more info ask. I understand what I wrote but you might not LOL

View 8 Replies View Related

ODBC Driver Woes!

Apr 29, 2005

I'm sure you've all seen this before - but, it's killing me. It's for a university project which is being demonstrated soon, and I can't get it working consistently!

When pages are loaded, I get the error -

Provider Error - 80004005, Unspecified Error /db/update_select.asp line 33 (line 33 is the connection to the database)

or

Internal Server Error 500 - Page cannot be displayed

And sometimes I get one about "Jet" "Threads", and ODBC stuff.

I'm guessing it's a driver problem, but I have no idea where to go from here! I'm running Windows 2000 Adv. Server, IIS 4 (I think) and my db is access 97 :O (I would have put a newer version on, but the CD-Rom is so old on the PC it won't take 700MB CDs! Argh.)

Any help would be greatly appreciated!

Ally
www.ally.nu

View 1 Replies View Related

Relationship Woes With Specific Query

Mar 9, 2006

I have a pretty standard relationship set up, with the following tables:

Customers: A row/Cust ID for each customer
WorkOrders: each customer can have multiple work orders (linked to Customers by CustID, individual ID is WOID)
Jobs: each work order can have multiple job records attached (linked to WorkOrders by WOID, individual ID is JobID).

As far as I can tell, they're fine and all other forms etc work, updating no problem, referrential identity is enforced etc...

Problems: When I go to make a "job allocation" query for subsequent form, I select: Customers, Work Orders and Jobs table (I then filter by location, but
this problem remains unfiltered also). They link up fine. The query isn't nonsensical either - it lets me add new data. BUT instead of showing all the customers and work orders for the location due for the location, it will ONLY display the records that have details in the Jobs table (the lowest in the relationship chain). Basically, If the jobs sections are empty or "unattempted", then NO details AT ALL will show up in the query. Which is a problem, because I want to see ALL the "unattempted" jobs in the area to allocate them, including customer data and work order numbers. I also need to have the jobs table present, so I can allocate a job date, a contractor etc.

I'm not sure what to do. As far as I can see, the set up I have IS very standard tables/relationships-wise. I have to work it out, otherwise I'm going to have to revert to some kind of 'super-table' (like in our old system) - which I am at loathe to do - I don't want to merge Work Orders and Jobs because that means a lot more typing for me.

Would cascade update in the relationships do anything? (it is checked).

I've been away from Access for awhile and I'm just drawing a blank on this one. Any help greatly appreciated. Thank you.

View 2 Replies View Related

Lookup Field / Autonumber Woes

Jun 21, 2006

So, basically my database has quite a number of lookup fields in tables as there is much repeated data, each one references to a seperate table with an autonumber field (ID) and a text field (Value)

Currently I have column one (ID) as the bound column in such cases, as this is what the guy who started me on access said to do, and it's fine until I try and export any query with such a field to Excel.

I have found, through experimentation, that setting the 2nd column (Value) as the bound column allows me to export the values rather than numbers, but I don't know if this is a sensible thing to do? (ie, I don't know what other unexpected effects this might have)

Any guidance here would be very welcome, thanks,
Bogzla

View 8 Replies View Related

Null / Non Existent Values And Query Woes.

Aug 12, 2006

Hi there.

I've attached my db in the hope someone can help my head scratching.

I have got a Sales summary table with several other related table. Most notably, a table with the items in the sale and one with the costs. Because each sale might contain many different items and many different costs, I thought seperate tables were the way to go.

All I'm trying to do is make another query that gets the total sales (That's adding each line item * quantity) - (Each cost line item*it's quantity) and then finally the margin made on the deal.

However, if there are no costs or sales involved in the sale the query ignores it. (Sounds odd, but some transactions might be cost free, and some may not involve any revenue - so I have to bear it in mind).

I tried the Nz function, but It's either not what I need or I'm doing it wrong.

How do I get this to work?

Many, many thanks!

View 2 Replies View Related

Help With A Querie

Sep 12, 2005

i have 2 tables jobs and jobs_details jobs have the fields name date account etc.
jobs_details have the print area, file, etc.
i need a querie to give me the total print area for each account on a particular date but i can't get it to work.
I've tryed this:
"SELECT DISTINCT jobs.Account, Sum(jobs_details.PlottedArea) AS SomaDePlottedArea, Sum(jobs_details.UsedArea) AS SomaDeUsedArea, jobs.JobDate
FROM jobs LEFT JOIN jobs_details ON jobs.JobID = jobs_details.JobID
GROUP BY jobs.Account, jobs.JobDate
HAVING (((jobs.JobDate) Between #3/1/2005# And #4/1/2005#))
ORDER BY jobs.Account;"
but it returns all the jobs.Account(it doesn't give the distinct) by all the dates

what am i doing wrong???

View 4 Replies View Related

Between Querie

Jul 13, 2007

Hi there

I've got the following query in my application:
SQL = "INSERT INTO tblreport3 ( exchange, NoCustomers2, [time] )"
SQL = SQL & "SELECT Table1.Exchange1, Table1.Customers1, Table1.Duration"
SQL = SQL & "FROM Table1"
SQL = SQL & "WHERE (Table1.IncStart Between #txtdatefrom# And #txtdateto#);"
DoCmd.RunSQL (SQL)

The problemis when I run the application it gives me a error 3075 saying missing operator in query expression.

Can someone please tell me what is missing here?

Thansk

View 1 Replies View Related

How I Can Run The Querie With VB???

Feb 18, 2005

Hi

How i cun Run Queries with VB

My Querie : Delete Records in table1, It Query in access no string of VB

I want when i delete one record in table2 run this Querie

I try with this command DoCmd.OpenQuerie DelNoExistsRec.
but i hav one message : The action or method requires a Query name argement????

View 5 Replies View Related

My Querie Keeps Duplicating

Nov 25, 2005

Hi

Please can some help me asap. I need to do a querie which joins two tables together. I have a telemarketing table and an appointment table. The idea is that when an appointment is made telemarketing should be done afterwards to the same company. Therefore I want to view all of the telemarketing done and all of the appointments done and then match companies which have had both an appointment and telemarketing. However when i do this if there has been more appointments made for one company that there has been telemarketing the telemarketing duplicates itself so that the two have the same amount done which is not what I want??? Does this make sense?? Can some one please help????

Thanks

View 5 Replies View Related







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