Running A Query To Modify A Field NOT Record

Feb 21, 2006

Is it possible to run a query/filter in order to hide/show a field in a record instead of it affecting the entire record.

What I'm trying to do is, in a form the user can enter information about a service call and they can enter a recommendation for the next visit. When they enter a recommendation they are able to select which month the recommendatin should pop up. This Service report get's printed on a monthly basis as a report. Now the recommendation field should only pop up if that particular month which was selected earlier is true. I've tried different methods, but it would affect the entire record as opposed to just one field.

Thanks.

View Replies


ADVERTISEMENT

Modules & VBA :: Modify Progress Bar So Instead Of Saying Running Query?

Nov 8, 2013

Is there any way to modify the progress bar so instead of saying "running query" it states the name of the query?

Like: Running Query [qryFRED] <progress bar>

View 1 Replies View Related

Modules & VBA :: Running Update Query On Record And Have Form Show Updated Record

Jan 26, 2015

i want to be able to create an On Click Event when pushing a command button that will run an Update query to update a record and after it has been updated that specific record will pop up on a Form and be displayed. i know a different way is to run the Update query and then have it displayed in a Select query but i want it to be displayed on a Form instead. is it possible?

View 4 Replies View Related

Modules & VBA :: Modify Existing Record In DAO Record Set

Jul 18, 2013

I have written the following code. I want to change the status of my order when reminaing products shipped is equal to zero. When I run this code I get error " Cannot update. Database or object is read only". I think that this error is because that I am using the front end of the database.

Code:

Private Sub Form_AfterUpdate()
Dim dbs As DAO.Database
Dim rstTest As DAO.Recordse
Dim strQuery As Strin
strQuery = "SELECT OrderingT.Order_ID, OrderingT.UnitsRequested,OrderingT.OrderStatus, ([UnitsRequested])-Count([Product_ID]) AS [The Remaining

[code]....

View 12 Replies View Related

Running A Query Based On A Select Record In The Form

Jun 13, 2006

Hi,

I have a query that I would like to run from a form. I have created the button and the query, but want to add in a clause that will use the user selected record / field as the criteria for the query when its run.

Got any examples of code I could have a play with

I am struggling here so need any help I can get!!

Cheers
Paul

View 1 Replies View Related

How To Modify A Field Value?

Jan 25, 2005

Hi,

I am trying to change the value of a field (well a few fields once I get it to work for one!) in a table.

I am trying to update the last record in a table, but cannot get any code to work in VBA for this and cannot make an update query select just the last record in the table to do it that way either!

The VBA I am using is:

Dim db As Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("Inventory Transactions", dbOpenDynaset)

With rst
.MoveLast
.Edit
![UnitsOrdered] = (Me.UnitsOrdered - Me.Qty_Passed_Insp)
.Update
End With
rst.Close
db.Close

Units ordered doesn't change though!


For the update query I am trying the following criteria for the transactionID field:

=max( [Inventory Transactions]![TransactionID] )

But this returns the error message:

"Cannot have aggregate finction in WHERE clause ([Inventory Transactions].TransactionID = Max([Inventory Transactions]![TransactionID]))"

Any suggestions?

Thanks in advance!

View 9 Replies View Related

Can't Modify/add Records Because Of Record Source With COUNT Function!!!!

Jun 19, 2006

I modified a form and now it seems it's impossible to modify/add records. It seems that all comes from when I modified my record source query to add a a field in which it COUNTs all related records in another table. Now the form can't modify anything else but I need to change other fields or add new records!
In other words: how can I add a simple box which, for every record of my table/form, counts the number of related records in another table (relationship is 1-to-many, and of course is based on a field in table2) letting me modify and add records?
Thank you

View 13 Replies View Related

Modify Date / Time For Multiple Fields In The Record

Jul 2, 2014

automatically adding modified date/time to a record as it changes..I have a work log database for a team of people to keep track of workflow (documents in/out, stage in the workflow, owner of the record, etc.). I have a number of records that I want to automatically update a corresponding date/time field when it is changed. For example, one part of the workflow tracks a document through the approval of 5 different people. So I have a five records that are yes/no flags for approval and five records that are date/time for when it was approved. Right now my team is manually entering the five date/time stamps, but I'd like to have it automatically update when the check the "yes" box and update that field in the record.

View 8 Replies View Related

Queries :: Running Total Field In Query

May 20, 2015

I have a table with dates in field1 and an amount of seconds in field2.

field1 field2
01/01/2015, 1345
02/01/2015, -132
04/01/2015, 259

I would like to produce a query that performs a running total in the third column like so:

field1 field2 field3
01/01/2015, 1345, 1345
02/01/2015, -132, 1213
04/01/2015, 259, 1472

This is quite simple to achieve in Excel. (eg =SUM($B$1:B3))

What is the query formula for Access?

View 1 Replies View Related

Queries :: Running A Query From Selecting Field Name

Jun 3, 2015

I have a table of prices for commodity contracts, with my first field showing the dates the prices are from and the subsequent fields relating to the individual contracts (contract A, contract B, contract C, etc.)

I want to run a query that allows a date range to be selected, and a contract to be selected.

the first part I am pretty sure i know how to do (Between [Enter Period Start:] And [Enter Period End:]), but its selecting which contract i want this range to apply to that I am not sure how to do.

Can this be done in the same query? or would i have to do something like create a separate query for each contract and then use a form with a selection box that chooses which query to run?

View 7 Replies View Related

Modify Query

May 18, 2007

Hi,

I create one database and the query and the forms for my clients in the sharing drive. Every time, the user open the form and select the field names and then execute the query depend on which fields the user select on the form, and then output to the screen. Here is the question, if there are multi user access the same form/query, one user pickup 3 fields to run the query, and another user pickup 5 fields to run the query. Becuase one user select 3 field names on the form, and then the code will modify the query contents, another user select the 6 field names on the form, and then the code will modify the query contents.

So, will the query affect each other?

View 1 Replies View Related

Modify Query

Apr 25, 2006

Dim strSQL As String

strSQL = "SELECT [Company Name],[Vendor Name],[Account],[Statement Number],[Amount] from [Statements] "

Dim cat As New ADOX.Catalog
Dim cmd As New ADODB.Command
Dim qry As ADOX.view
cat.ActiveConnection = CurrentProject.Connection
Set cmd = cat.Views("Statement Informations").Command
cmd.CommandText = strSQL
Set cat.Views("Statement Informations").Command = cmd

Set cat = Nothing
DoCmd.OpenQuery "Statement Informations"


I used the above code to modify the existing query, "Statement Informations".

When I run it, it give out the error message:

Run-time error '3218':
Could not update; currently locked.

And then, I went to queries section, and open the query "Statement Informations" directly, close the query, and then run the code again.
Then, it works.

I don't know why.
If I run it on next machine on other day, then it give out same error.

How can I solve it?
Please let me know, thanks.

View 1 Replies View Related

Modify Data Using A Query

Jun 1, 2006

Hi all,

Is it possible to modify data using a query.

Say for instance I have a whole load of IP's in a table in the form of A.B.C.*, where and and B are fixed, C varies slightly and * can be anything from 1-255. Can I use a query to look at an IP and the append an IP record to a different table in the form of A.B.C.0. Basically, modifying the data so that whatever the value of *, it is changed to 0.

Cheets,

Matt

View 2 Replies View Related

Modify Query For A Report

Jan 9, 2007

Hi all

I have a report rptTeamPickStats which source is a query qryTeamPickStats

The query has columns such as name, id number etc which are GROUP BY and hours, cases as SUM and there is a DATE field where I originally had a WHERE statement specifying the from and to dates.

I want to be able to modify the where using VB so I don't have to have several queries.

The code below doesn't work (probably won't take you long to realise that) but just to show kind of what I'm after.

I want to query all the TLName where the date is between to dates.

DoCmd.OpenReport myReport, acViewPreview, "", _
"[TLName]='" & myFilter & "' And qryTeamPickStats!Date >= #" & myFromDate & "# And qryTeamPickStats!Date <# " & myToDate & "# And [OTcode] " & myOp & " 'NA'"


Hope this makes sense

Cheers

Kev.

View 5 Replies View Related

Can't Modify Values In A Query

Feb 4, 2008

Hi!

It has happen to me many times that when I create specific queries I'm then not able to modify the values of em...

Do you know the possible causes of this?

Is it because I'm filtering? Ordering by? Grouping? Using fields of differents tables related 1-many? Calculated fields? Expressions? Modules?

----------

One specific case that has presented to me is a query that returns info from 1(main)-many(details) relationship. When I use the sorting of a field of the main table it doesn't allow me to edit values, tho when I delete this sorting it works fine.

Nevertheless, I also have another query which just returns values from one table and whether I use sorting or not, I can modify the values.

What's happening??? :( :confused:

View 1 Replies View Related

Can Anyone Modify This Query Statement

Apr 6, 2008

hi im a first time user of access,

can anyone modify this query statement...

select IDno, LName + ', ' + FName as Name, course, Status,
(select count(io.AC) from in_out_books io where io.IDno = b.IDno and io.DBorrowed >= '2008/03/01' and io.DBorrowed <= '2008/04/30' group by io.IDno
)
as TotalBooks
,
(select sum(io.Penalty) from in_out_books io where io.IDno = b.IDno and io.DBorrowed >= '2008/03/01' and io.DBorrowed <= '2008/04/30' group by io.IDno) as Penalties from borrowers b


i also want to set the TotalBooks and Penalties to 0 when their values are null thanks

View 3 Replies View Related

How To Modify Data Retrived Form A Query !?

Mar 27, 2006

i am very rookie with access.. infact i am doing my first project in access for a friend.. here is my doubt...

this frnd has toy making business.. he wants to keep track of this inventory... i have made one table (ItemId(PK), Item descripstion, noOff, parentItem(FK), stock)..
noOff is the no of child items required for a particular parent item..

now i have to run a query to get all the items which have same parentItem.. for this i designed a form... have put 3 text boxes and a subform.. one to accept the parentItem.. 2nd to display its description.. 3rd one to accept no of parent items which i wud be the multiplying factor for the child item noOff.. (default is one..)

http://img.photobucket.com/albums/v355/sledge045/171205/form_prd_data.jpg

now i can retrive the parentItem id.. from the form and use it in the WHERE clause...


SELECT ItemData.ItemID, ItemData.ItemDescription, ItemData.noOff
FROM ItemData
WHERE (((ItemData.ParentItem)=[Forms]![Display Product Data]![txtProdId]));


but i want to retive the value in the No off: box and multiply it to all the child item's no off...

i have tried to multiply ItemData.noOff with [Forms]![Display Product Data]![txtNoOff] but did not got the desired results....

i need help with this... or if u know ne other way to do it... plese post a reply... thanks...

View 1 Replies View Related

Queries :: Modify Titles Of Query Fields?

Jan 17, 2014

I have a simple Query which very satisfactorily exports data to a Tab Delimited Text File to upload to a website.

The field titles are dictated by the Table Field Names but I would like to modify these for the export. Is there a simple criteria code by which this can be achieved.

View 7 Replies View Related

Can't Modify Fields In Form With Table INNER JOIN Query

Oct 5, 2004

Hello, exactly how Access 2002 and SQL operate is still a bit fuzzy to me.

In brief:
tableAccounts has fields for Signatory1ID and Signatory2ID, and other stuff
tableSignatories has ID for a primary key and has SignatoryTypeID as a field
tableSignatoryTypes has ID for a primary key and SignatoryType as a field

For each account, on a Form I want to show the Signatory and SignatoryType info for both signatory1 and signatory2. I have tried creating various queries and INNER JOINing the tables and/or queries together, but whenever I manage to get all the information displayed, none of it is editable. Access seems to lock the various text boxes and combo boxes.

Any thoughts?

View 2 Replies View Related

Queries :: Modify Access SQL To Exclude Data From Query

Apr 13, 2013

I have been successfully using the following statement in Access 2010 to retrieve data from a large csv relational database:

SELECT [1995_1].RPT_REC_NUM, [1995_1].PRVDR_NUM, [1995_2].WKSHT_CD, [1995_2].LINE_NUM, [1995_2].CLMN_NUM, [1995_2].ITM_VAL_NUM
FROM 1995_1 INNER JOIN 1995_2 ON [1995_1].RPT_REC_NUM = [1995_2].RPT_REC_NUM
GROUP BY [1995_1].RPT_REC_NUM, [1995_1].PRVDR_NUM, [1995_2].WKSHT_CD, [1995_2].LINE_NUM, [1995_2].CLMN_NUM, [1995_2].ITM_VAL_NUM
HAVING ((([1995_2].WKSHT_CD)="A000000") AND (Not ([1995_2].LINE_NUM)="09500") AND (([1995_2].CLMN_NUM)="0100" Or ([1995_2].CLMN_NUM)="0200"))
ORDER BY [1995_1].RPT_REC_NUM, [1995_2].LINE_NUM;

This query returns one long column of line numbers (LINE_NUM) representing the itemized salary (CLMN 0100) and non-salary expenses (CLMN 0200) and a total for each of the organizations represented in the data base. My question is: is it possible to modify the query so that it returns only organizations whose data passes that following test that checks to see if the itemized line numbers 00100 to 10099 equal the total for each organizations line 10100: SUM(LINE_NUM 00100:10099)=SUM(LINE_NUM 10100:10100).

I have tried several times to upload a sample file but have been prevented from doing so because of a missing security token. I have communicated this to the administrator.

View 9 Replies View Related

Modules & VBA :: Modify Working Code - Export Query And Update Worksheets In Excel Template

Mar 12, 2014

What I want to do instead is open an existing .XLSM wokrbook delete or update the 7 sheets it creates and replace them with the new query results from access.

I love this code below because it works really well but now I have a new requirement. I have a workbook that has a "dashboard" sheet that looks at the sheets from acccess and summerizes the data. So, I'd like Access to open that "template" excel workbook and delete the old sheets and put in the new ones..The required sheets to keep are called "Metrics", "Validation" and "Mara"

What I was trying to do for the past few hours was another work around which was to have Access run this code, then excel run some code to import the "dashboard" formulas but I can't get it to copy to another workbook because it links to the OLD workbook..Here is the working code that needs modding:

Code:

Option Compare Database
Public Function ExportAdvanced()
Dim strWorksheet As String
Dim strWorkSheetPath As String
Dim appExcel As Excel.Application
Dim sht As Excel.Worksheet
Dim wkb As Excel.Workbook
Dim Rng As Excel.Range
Dim strTable As String
Dim strRange As String
Dim strSaveName As String
Dim strPrompt As String
Dim strTitle As String
Dim strDefault As String

[code]...

View 3 Replies View Related

Running A Function When Moving To Next Record

Mar 13, 2006

Hi,

How can i run some vba cose directly after i click the move next button on the navigation but at the bottom of the form.

Thanks
k0r54

View 2 Replies View Related

Why Format Event Code Running On First Record Only

Aug 28, 2013

I have a report with several sub reports that run and fill a table conditionally. The third sub report displays the records from this table. It works perfectly.

If I print a batch of records, it also works perfectly - but only for the first record. Previously, I had another report with several sub reports where the visibility of objects were controlled - this worked fine in a batch. Every subreport had the correct visibility settings.

In this case, I have a similar design, but instead of setting visibility on the various subreports, I am filling a table based on data in the subreport. As stated it works great for the first one in the group, or any single print.

View 4 Replies View Related

Queries :: Running Total Multiple Record Values

Mar 21, 2014

I am having an issue with my running total query.

It consists of a running total per vehiclenum. All data comes from one table.

It works properly only on the first vehiclenum of the query. After that, the first "previous" odometer reading of each subsequent vehiclenum starts at some erroneous number, throwing the remainder of each vehiclenum running total.

Here is the code for the query,

SELECT qry_ODO_TotalSub.ID AS OdomAlias, qry_ODO_TotalSub.ODate, qry_ODO_TotalSub.VehicleNum, qry_ODO_TotalSub.Odometer, Nz(DLast("Odometer","qry_ODO_TotalSub","[ID] < " & [OdomAlias]),0) AS Previous, [Odometer]-[Previous] AS Difference, Nz(DFirst("Odometer","qry_ODO_TotalSub"),0) AS StartOD, [Odometer]-[StartOD] AS RunningSum
FROM qry_ODO_TotalSub
ORDER BY qry_ODO_TotalSub.ID;

View 4 Replies View Related

Queries :: Running Sum Of Percentage Field

Jun 17, 2015

I am trying to make a query that give me an output of an aggregate percentage column, or running sum of percentage. Please see my example:

Month Sales in % Running sum percentage
Jan 5.03 % 5.03 %
Feb 2.17 % 7.20 %
Mars 1.28 % 8.48 %

I have the column Month and Sales in %, What do I have to do to get an output like the example over?

View 2 Replies View Related

Show All Records From One Query And The Sum Of A Field In A Related Query Record

Mar 8, 2005

I'm building a report for annual software license renewals. The report data source is a query that combines the customer information, their computer information, and the licenses purchased for that computer. I am having no trouble with the form displaying the customer info page, then a page with the computer info at the top and a list of licenses purchased for that computer underneath.

That would be great, if that's what my boss wanted. However, she wants the whole list of available licenses displayed on each page, in the event someone want to purchase additional licenses with this year's renewal.

I'm trying to figure out how I can set up a query/report grouping to do that. I've tried making a new query, relating the qryLicense!licenseID to the qryPurchase!purchLicense and setting the relationship option to show all records from qryLicense and only those related from qryPurchase. I added the qryPurchase!purchCPU field to my query, hidden it, and set the criteria to “=1” (the computer ID of one of my dummy computer records). I also have a Sum of the qryPurchase!purchQty field included in the new query that I want to display the total number of that particular license purchased (and 0 if there are no corresponding records). All fields except for the quantity field are set to Group By.

What I’m getting from this is simply a list of the licenses purchased for that computer, not the complete list of licenses available showing the quantity purchased where applicable.

Can someone see where I’m going wrong?

Slaughter
slaughter at mizzou dot edu

View 9 Replies View Related







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