Process Each Line Of Update Query

Sep 8, 2006

I have this update query that does not quite work. I have attached a picture of the design view. What I need to do is process each line and update the processed field (yes no) to minus one to then exclude that record. Unfortunately when this query runs, it sets the processed field after matching all records.

So how do I process line by line

View Replies


ADVERTISEMENT

UDFs That Accept Arguments To Process UPDATE/INSERT INTO SQL Stmts?

Mar 17, 2006

Before attempting to create a VBA User Defined Function that will accept arguments for creating UPDATE/INSERT INTO SQL statements, I thought I would check to see if some already exist. It seems like a very tough task to tackle. I'd like it to determine the data type of the the values being placed into the specified fields and subsequently provide the appropriate syntax. (i.e. '" & mString & "', #" & mDate & "#, etc.) Do any exist?

I'm working with MS Access 2003.

Thanks,

Steve G.
:confused:

View 1 Replies View Related

UDFs That Accept Arguments To Process UPDATE/INSERT INTO SQL Stmts?

Mar 17, 2006

Before attempting to create a VBA User Defined Function that will accept arguments for creating UPDATE/INSERT INTO SQL statements, I thought I would check to see if some already exist. It seems like a very tough task to tackle. I'd like it to determine the data type of the the values being placed into the specified fields and subsequently provide the appropriate syntax. (i.e. '" & mString & "', #" & mDate & "#, etc.) Do any exist?

I'm working with MS Access 2003.

Thanks,

Steve G.

View 1 Replies View Related

Modules & VBA :: Update Recordset Based On Max Process Instance From Another Table

Jun 7, 2013

I am trying to update a recordset using VBA based on the max "process instance" from another table. After the code executes, the field I am updating is still blank.

Code:
Set rs = db.OpenRecordset("myTable", dbOpenDynaset)
If Not (rs.BOF And rs.EOF) Then
rs.MoveFirst
Do Until rs.EOF = True
emplid = rs![Employee Number]

[Code] ....

View 5 Replies View Related

Modules & VBA :: Process Records Without Dates First And Then Run Another Process To Split Those With Dates?

Aug 18, 2014

I'm not sure if I am biting off more than I can chew. I have a text field in each record in my database (Inherited) The db has nearly 5,000 records. I would like to split the field into records in a seperate table. An Example of the table as is now;

Code:
MemberIDBoats
5882Opossum(78-80) (87-89) Otter(80-84) Opportune(91-93) Turbulent(97-00).
5883Astute Auriga Aeneas Affray Amphion
2407H34 O10 Porpoise Trenchant Tapir.

I want to create a table as follows;

Code:
MemberIDBoatFromTo
5882Oppossum19781980
5882Oppossum19871989
5882Otter 19801984
5882Opportune19911993
5882Turbulent19972000
5883Astute
5883Auriga
5883Aeneas
5883Affray
5883Amphion
Etc.

Is this possible in one hit or do I need to process the records without dates first and then run another process to split those with Dates? I say dates but the field is a text field. About 15-20% of the records contain dates which are always enclosed in parenthesis.

View 14 Replies View Related

The Higher The Database Size, The Slower The Query Process?

Jul 10, 2007

I am developing a database and testing it with dummy data. With 50,000 records, the query process using SQL command is just OK. But if I double the total records, the query process takes longer time. The query is to make recapitulation using SUM of SQL command based on certain criteria. Any idea to make the query faster?

Thanks.

View 2 Replies View Related

Modules & VBA :: How To Process A Select Query Using Listbox Value As Where Variable

May 6, 2015

I am using Access 2013. I have the ability to pull a selection from a listbox. I can create a Select Sql string using that variable

sql As String, strCompany As String, strWhere As String
strCompany = strCompany & Me.lstResource.Column(0, varItem)
strWhere = "[Company name]=" & "'" & strCompany & "'"
sql = "select * FROM tblResources WHERE " & strWhere

From here I have trouble. I see lots of examples to run an active query but not much on a select query. I have tried a number of things with no success. How to use this select statement to actually run against an existing access table? I am not putting it into a form or report at this time, just running the query to check results.

View 1 Replies View Related

Update Memo Field With Line Breaks

Jan 6, 2006

I have a memo field that contains several text strings separated by line breaks. I would like to write a query to add another text string to the end of the field. How do I embed a line feed in the SQL?

View 3 Replies View Related

Modules & VBA :: Way Of Looping Through Continuous Form Recordset And Running Update On Each Line?

Jun 11, 2014

i have set up an update query. is there a way of looping through a continuous form record set and running the update on each line?

View 2 Replies View Related

Correct Syntax To Write Command Line Able To UPDATE More Than One Field In Table

Nov 24, 2014

what is the correct syntax to write a command line able to UPDATE more than one field in the table records having multiple WHERE criteria.

Here is my challenge:My TableI has the columns A, B, C and D which are populated, for example, as follows:

TableI
A B C D
1 2
2 6 4 3

1 7 5 9
1 2
2 5 8 5
etc.

I also have a FormII which updates TableII. Among the existing fields of TableII there are the fields C and D (same as above). When saving data entry thru the save button of the FormII, fields C and D will be naturally saved on the TableII. Well, I also want C and D info updated into Table I as well, but only when field A=1 and B=2.So what I need (for the click event of the button save in the FormII) is to open TableI and either insert or update it with the values of the fields C and D in every record WHERE A=1 AND B=2.For instance, assuming C=& and D=%, the desired result should be as follows:

TableI
A B C D
1 2 & %
2 6 4 3
1 7 5 9
1 2 & %
2 5 8 5

I did not find any examples in the net including multiple criteria..Here is what I wrote unsuccesfully:

Private Sub BtSalvarFrmII_Click()
CurrentDb.execute "UPDATE TableI"
Set FieldC = Forms!FrmII!FieldC.value AND Set FieldD = Forms!FrmII!FieldD.value WHERE FieldA = 1 AND FieldB = 2
Docmd.save
Docmd.close
End Sub

What would be the correct syntax?

View 7 Replies View Related

Queries :: Remove GROUP BY Line And Stick Semicolon At End Of Previous Line

Jun 25, 2013

Here's the statement

Code:

sqlfinal = "SELECT Employees.ID, Employees.Name "
sqlfinal = sqlfinal & "FROM ((qryDeptVBA INNER JOIN qrySkillVBA ON qryDeptVBA.ID = qrySkillVBA.ID) "
sqlfinal = sqlfinal & "INNER JOIN Employees ON qryDeptVBA.ID = Employees.ID) "
sqlfinal = sqlfinal & "INNER JOIN qryAreaVBA ON Employees.ID = qryAreaVBA.EmpID "
sqlfinal = sqlfinal & "GROUP BY Employees.ID, Employees.Name;"

If i simply remove the GROUP BY line and stick the semicolon at the end of the previous line (.EmpID; ) it works just fine. How is adding a group by line causing an error?I tried adding another parenthes at the beginning ((( and ending the joins as EmpID); and that failed with the exact same error.

View 12 Replies View Related

Forms :: How To Get Values From Line Items Form Inserted Into QUOTE LINE

Jun 5, 2014

I have a main form with 3 sub forms. The main form is tied to a table called QUOTES_MASTER. The first sub form is tied to a table called QUOTE_ LINE_ ITEMS_DIRTGLUE. It calculates the subtotal when selecting items. The relationship is one-to-many linked on QUOTE_ID.

The second sub form adds up total of all line items and is not tied to a table.The third sub form adds ESTIMATED FREIGHT to the PRODUCT TOTAL and is not tied to a table. how to get the values from the line items form inserted into the QUOTE_LINE_ITEMS_DIRTGLUE table as they are added.

I also want to insert the total value from ESTIMATED DELIVERED into the LINE_TOTALS field in the table QUOTES_MASTER.I tried this code on the product total sub form but it doesn't do anything and there are no errors:

Private Sub PROD_SUB_AfterUpdate()
DoCmd.RunSQL "UPDATE QUOTE_LINE_ITEMS_DIRTGLUE SET QUOTE_LINE_ITEMS_DIRTGLUE.SUBTOTAL = Me.PROD_SUB WHERE QUOTES_MASTER.QUOTE_ID = " & Me.QUOTE_ID

View 6 Replies View Related

Modules & VBA :: Read CSV Transaction File Line By Line And Add Correct Transactions To Access Table

Nov 29, 2014

I have a module which reads a CSV transaction file line by line and adds the correct transactions to an access table and places the wrong ones in a logfile.Now some transactions are rejected twice there is even one rejected six times. Whereas one wrong transaction is processed only once. I am certainly overlooking something obvious in the logic but what. Here is the relevant code.

Code:

Function ImportCSVForConfederation(inputCSV, ORG)
Dim TNO As Integer, TACT As Integer, TABLE As String, TLINE As String, I As Integer, J As Integer, K As Integer
Dim FLD1 As String, FLD2 As String, FLD3 As String, FLD4 As String, LogFile As String, LogPath As String
Dim Lim As String, ITNO As Integer

[code]....

View 8 Replies View Related

Modules & VBA :: How To Import Text File Line By Line

Nov 18, 2014

I am having a little difficulty with my importing in Access. Every time I import my text file, the lines will be jumbled. I have been reading up and I found this recordset code that seems to be what I need:

Code:
Dim strLine As String
Dim intLineNum As Integer
Dim MyDB As DAO.Database
Dim rst As DAO.Recordset
Open "C:TestTest.txt" For Input As #1
Set MyDB = CurrentDb
Set rst = MyDB.OpenRecordset("tblResults", dbOpenDynaset)
CurrentDb.Execute "DELETE * FROM tblResults", dbFailOnError 'Clear tblResults

[code]....

Basically, this code will extract data from the text file as long as it fulfills the Mid$ criteria. Here's where my problem comes. Each line in my text file is of different lengths and I have to capture the entire line.

I think using the Left$ function would work, but I don't know how to determine the character count such that the entire line of text would be inserted into the table.

Another difference between what I need and the code above is that, I am required to store each line into each row of my table, meaning

Line 1 is placed in Row 1 Column 1
Line 2 is placed in Row 2 Column 1
Line 3 is placed in Row 3 Column 1
.
.
.
Line X is placed in Row X Column 1.

View 14 Replies View Related

Forms :: No Line Only Marker In Line Graph

Oct 18, 2014

I can change multiple things on a line graph with VBA.

Me.Graph47.chartType = GraphType ' take 65 for line
with me.graph47
.SeriesCollection(1).border.Color = vbblue ' change the line color
.SeriesCollection(1).border.Weight = LineWeight ' change the line weight to for example 3
.SeriesCollection(2).MarkerSize = MarkerWeight ' Change the marker weight, for example 4
.SeriesCollection(2).MarkerBackgroundColor = vbblue ' Change the marker color,
.SeriesCollection(2).axisgroup = 2 ' put this series on the secondary axis
end with

SeriesColection(1) is line with markers. This is correct.But now I want the seriescollection(2) without line, so only the markers. I cheched the MSDN site from Microsoft. The Excel trick with the macro does not work for me.how to hide the line with VBA for only SeriesCollection(2) in Access?

View 1 Replies View Related

Last Line Query

Aug 23, 2007

Hoping someone can help!:(

I have a table in access which holds interest rates details, and a query that displays the latest interest rate entered into the table (on the last line) by using the Last option in the Totals field.

The problem is that when I enter any new data into the table the query doesn't see this and continues to display the data which is now on the second to last line. The query for some reason just doesnt seem to notice the new last line.

Is there a solution to this so that it shows the new last line?

Thanks is advance!

View 1 Replies View Related

Line Spaces In Query?

Jan 2, 2008

Hi,

Does anyone know if its possible to have a page break/line space in a query's results?

For example, a query returns 5000 results, and after every 45 there is a space of 2 or 3 spaces. When I say "space" it could be a couple of empty records or rows.

The reason I ask is because I use a query to filter the records I want from my table. I then use a make table query to make a new table with these records, then I use a macro to export the table into a .txt file.

This text file is then used as a product feed, except the web application I use to import the data can only take a maximum of 50 records - so it'd be nice to already have a space so when I cut and paste the records into the web application I don't accidently try to import 51 records and mess everything up.

I know it's a strange one, but if theres anyway of setting the format of the .txt file to contain spaces would save a lot of time.

Any ideas would be welcomed, thanks for your time.

Dean

View 3 Replies View Related

How Do I Repeat A Process For Many Db's?

Jan 6, 2006

I have about 125 .mdb's I want to go through, and in each one, select a table and run a "find duplicates" query, creating a table of duplicate record info for research into why there are duplicates.. I am aware I can manually do this within each .mdb, but would be happy to be able to automate the process.

I wasn't sure what to search for, which is the reason for my posting. If anyone has an idea (and not questions on why I want to do this, or probs. I might encounter), I would be most appreciative.

Thanks!

View 4 Replies View Related

VPN - Process Are Too Slow!

May 30, 2007

I developed a sales database that contains around twenty forms, (in addition to tables, queries, reports and 2 modules). In these forms, I'm setting recordsets, select statements and filters. We recently hired a person to set up a Virtual Private Network. After spending a couple of thousands on a server and countless hours reprogramming the database to have multiple users access the database out in the field, (via Verizon broadband network card), we were unsuccessful to use the database since it was taking too long to download the data or perform any calculations. The database is split. The users have a front end.

The person setting the VPN has suggested that I get rid of all the queries that I have in the forms (which is impossible), or use Visual Basic for the front end instead of Access with VBA.

When I set up the recordsets I use the following setting:
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
rs.LockType = adLockOptimistic

I don't know what to do. This program is very complicated and I don't want to have to reprogram the whole thing with Visual Basic, and I don't know how the front end is going to work if I eliminate all the queries, select statements and filtering.

Any ideas, comments or suggestions would be appreciated.

Maritza

View 2 Replies View Related

Button Does More Than One Process

Mar 29, 2006

Hi all,

I need a button on a form to not only add a new record but also run a query. I can't see how to do this using a macro and my coding experience is limited. How can I get this button to do both of these actions?

I think that I should add that the add record action must happed first. However, I have noticed that this automatically increments the record number in the navigation section to the next number and blanks the firelds in the form (which is data entry mode). As the query relies on information given in the fields on the form, i don't want the field to be blanked. I'd like the the for to stay on the same record until the query has finished. Once this has happened, I'd like the form to reset itself so that it looks as if it's just been opened and the first record is the new record (just as if you'd opened a form in data entry mode).

Sorry, complex I know. :( :confused: I'm sure there's some one out there how's got the answer though. :cool:

Cheers,

Matt

View 5 Replies View Related

Modules & VBA :: Print Every Line From The Query

Mar 16, 2015

I have a query and I am prompted for a " nco " number. This could produce any amount of lines.

What I would like to do is have some code that will ask me the NCO number then print of a report for each line item from the query so if I have 10 lines I need 10 reports .

My query name is "internalworksorder" ...

View 1 Replies View Related

General :: Start Of Day And End Of Day Process

May 3, 2014

In my database i need two process in the database one is SOD(Start of Day) and the 2nd one is EOD (End Of Day). The purpose of these process to run multiple hidden queries in back-end. In both processes there are several queries to run. How i can built this but this is necessary for database. another thing these process execute only once a day. after login i want to run a form that will check that SOD is performed or not if not then SOD (Run SOD) Screen will appear if SOD not perform yet then system ask for SOD Process to run otherwise disable my dashboard items. and 2ndly if EOD not performed last day then system will run normally and not ask for SOD process.

View 4 Replies View Related

Find Records With A Line Break Using A Query

Apr 1, 2008

Hello all,

I want to create a query that looks for a manual line break in a memo field. Is there a code or some way that I can do this? (i.e in a Memo field the user has entered some data, hit Ctrl-enter to get to a new line, entered more data on the new line. I want to find the records where this has occured)

Also, on a similar note, is there a way I can deny my users the option of doing a manual break (Ctrl-Enter) in a Control in a Form? (to prevent me needing to run this query in the future)

Please advise.

tia,
Angel

View 2 Replies View Related

Query: Display All 3 Matches For A Field In One Line

Feb 19, 2006

Hi all, I'm new to this forum. I'm having a problem with a query I'm trying to create.

I have two tables in the database: tblCustomers and tblInstallations. These two tables are linked by a field 'CustomerID'.
CustomerID is the Primary Key in tblCustomers.
In tblInstallations, the primary key is InstID and for each CustomerID in tblInstallations there are either 1 or 3 InstID records.

Now what I want to do is create a query with fields: Customer; CustomerID; InstID1; InstID2; InstID3.
InstID1 will contain the first InstID for the CustomerID, and InstID2 & InstID3 will contain the second and third, if applicable.

I see in Query Design View in the 'Totals' line there is a option to display the 'First' and 'Last' match for a field. So is there any way i can use this method and also display the second record? If not, is there any other way to make this query work?

I hope somebody can help!!

Kerry

View 1 Replies View Related

Queries :: How To Add A Text Line To A Query Field

May 18, 2013

I have a combo box that gathers data based on a query. Is it possible to add a line of text to be displaed every time i pull down the box?

For example I have:

Data1
Data2
Data3

I would like to have:

Not In List (the added txt)
Data1
Data2
Data3

View 2 Replies View Related

MS Jet Database Engine Stopped Process ...

Aug 14, 2007

Dear All,
I prepared times ago a database that contains important data that will be frequently updated.
Since yesterday I cannot load the database anymore. I get a pop-up with following statement:
Quote
The Microsoft Jet database engine stopped the process because you and another user are attempting to change the same data at the same time
Unquote
If I click ok, the loading process will be aborted.
I'm the only user of this database, neither the database nor the directory containing the database is sharable. It is located on the harddisk of my computer which nobody from outside can access.
What can I do to recover the access to my database?

I use MS Office 2003 but tried to open the database also on MS Office 2000 with the same result.
The Help function of MS-Access does not really help.
Who knows how to solve the probleem????
With regards
Siegfried

View 2 Replies View Related







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