User Profile
Collapse
-
I love this site!!!! -
I need to tell you the same thing I've told ADezii...please extend your hand and give yourself a great big firm handshake of appreciation from myself!!! Your code works great!!! It took about 15 minutes for it to run through 40,000 records in tblLoop. Thanks again!!! =)Leave a comment:
-
Lysander, thanks! I bet this will work. I created a function for it below but I'm getting an error on this line of code:
db.execute(strS QL);dbfailonerr or
And it's asking me to define rsLoop (maybe because I have Option Explicit declared???). Anyhow, I'm a beginner with VBA, so I'm probably asking a real dumb question. Thanks for any ideas on how to make this work... =)
...Code:Public Function TestLoop() While Not
Leave a comment:
-
VBA Function to loop through records on one table to query another
Ok, this is a tough one. I need to query “tblRawData” where “fldID” equals “fldLoop” in “tblLoop” and append the results into “tblResults”. If I were to do this exclusively in SQL, it would look something like this:
INSERT INTO tblResults ( FldID, SRCTNE, SRYRNE, SRSER2, SRFMLY )
SELECT FldID, SRCTNE, SRYRNE, SRSER2, SRFMLY
FROM tblRawData, tblLoop
where tblRawData.FldI D = tblLoop.fldLoop ;
Also, you can... -
Thanks so much guys for responding and offering up insight into the dilemma I'm facing. ADezii, once again you knocked it out of the park! This line of code you offered was the key to overcoming the error message I was getting.
I also see what you are saying about running it in a separate session. However, in order for it to work, I had to run it inside of my UpdateToMaster( )...Code:DAO.DBEngine.SetOption dbMaxLocksPerFile, 15000
Leave a comment:
-
Well the verdict is in...ADezii is the VBA Master!!! Wow, your code totally ran with no hangups! To answer your question, it took a little less than 20 minutes to process that many records, but my connection is a little slow.
Anyway, you nailed it like always! Thanks again so much!!!
I have a separate issue with the same database I'm working on. Here's a link to the thread. VBA to change maximum number of locks allowed...Leave a comment:
-
Great, I'll give it a shot. I have to go offline for now, but I'm hoping to test it tonight or sometime tomorrow. I will definitely let you know the outcome! ;-)Leave a comment:
-
VBA to change maximum number of locks allowed on a recordset
Hi all. The code I run below runs perfectly in cases where I have a small amount of records. However, in cases were I have several thousands of records, the code only partially runs before giving me the error message of:
Code:"File sharing lock exceeded. Increase MaxLocksPerFile registry entry."
...Code:"You have exceed the maximum number of locks allowed on a recordset. This limit is specified by the MaxLocksPerFile setting in your
-
Hey ADezii, first of all I test your code and it worked beautifully with a couple of different scenarios in my database. Major KUDOS to you and a big THANKS!!!
I do run into a snag when I attempt to execute this code on a table that holds over 80,000 records. It works fine when it only contains a few records, but this many records results in an "Overflow" error.
Not exactly sure why, but it might be something...Leave a comment:
-
-
Hi ADezii, thanks for the quick reply. The reason I'm wanting to avoid writing midstring functions is because the field I'm working with is over 1600 characters long. Maybe there is a VBA function that could accomplish this, but I'm too much of a novice to piece it together.Leave a comment:
-
Query records where data values meet a certain criteria within string
In an Access Database for field2, the data values could consist of the following:
---field1-------------field2-------
Widget 1-----112398764567
Widget 2-----987611236789
Widget 3-----112345678901
Widget 4-----543287652345
I need a query that will check every 4 characters in the string of field 2 and look for all instances of '1223' OR '9876' are found. So my results would be Widget 1, Widget... -
-
Outstanding! Thank you, thank you, thank you so much for the extra you are putting into this. It is very much appreciated!!! The modification you made is terrific. The only exception is, it doesn't allow me to do mid string exceptions like this line of code did.
Is there anyway to apply this logic to the new code you provided?...Code:If recorg(intCount) = "929KA1" Or Left$(recorg(intCount), 3) = "816" Then
Leave a comment:
-
-
Transpose specific records to table (VBA)
Below is a very handy function that transposes fields from "Table1" into "Table2". Note, in Table1 the Field2, Field3, etc represent Option codes.
Basically it takes this...
Table1
ProdBreakDown --Field2----- Field3-----Field4
Widget1------------1253--------3843-------3986
Widget2------------1130--------1234-------3843
Widget3------------1234--------5698-------4207
... -
Hi NeoPa, it's somewhat more complicated. Basically I'm wanted to update existing records. I wasn't able to get an update query to accomplish fully what I needed. The above VBA module actually identifies which records did not have any match in the MasterTable, which is extremely pertinent to another process that I'm working with. Hope this makes sense. =)Leave a comment:
-
Thanks so much for answering my post. =)
I've been trying to get this figured out for three days now, but I finally received an answer in another forum. Here's the function that will accomplish precisely what I need. The credit goes to ajetrumpet from Iowa City.
...Code:Function kp() Dim updaterec As Boolean Dim db As dao.Database Dim rs As dao.Recordset Dim rs2 As dao.Recordset
Leave a comment:
-
KPR1977 started a topic VBA to update matching fields from one table and set unmatching fields to nullin AccessVBA to update matching fields from one table and set unmatching fields to null
In my Access Database in Table1, I have one record that looks something like this. (eg. "fldProd" represents field name, while "Apple" represents field value.)
fldProd - Apple (text value)
fldPIO - CF (text value)
fldFam - 1 (text value)
fldSer - 2 (text value)
fldTra - 3 (text value)
fldInt - LZ (text value)
fildQty - 5 (integer value)
The MasterTable looks like... -
No activity results to display
Show More
Leave a comment: