I'll try again:
I would like to increase the value of ValSum so that it is not the lowest, and the value of rst.Fields(0) in the first/top record changes, do to these new inserts.
What I would need in this case is the value of the new rst.Fields(0) that refers to the new lowest ValSum...
I would to increase the value of ValSum so that it is not the lowest, and the value of the first/top record in rst.Fields(0) changes do tto changes in the Data-Base, without having to move rst Pointer.
I'll make it short:
Dim ID as Long
Dim rst as DAO.Recordset
Set rst = CurrentDB.OpenRecorset("SELECT GroupID, SUM(Val) As ValSum FROM Table1 Order By SUM (Val) ASC Group By GroupID")
rst.MoveFirst
ID = rst.Fields(0)
Do while ID = rst.Fields(0)
CurrentDB.Execuet("INSERT INTO Table1 (GroupID...
Hi,
My clients have on there desktop an App, that at execution this code:
Private Sub copyAndOpenFile(Folder as String, FileName As String)
FileCopy Folder & "\" & FileName, "C:\Temp\" & FileName
dOpenFile.OpenFile "C:\Temp\" & FileName
End Sub
Very simple code to achieve your...
First: in VBA, when function parameters are put in parentheses [()], function result is expected to be assigned to a variable:
VarName = My.Computer.Network.DownloadFile(FilePath, "C:\Users\" & GetUserName & "\Desktop\FileName") That is the expected '='.
Otherwise, you can remove the...
Hi, and thanks for the reply,
no, it's not new, I haven't touched these declarations and references since about 2009. How new would this reference be? (I could refer to version 3.0 too. how old is it?...)
As far as I recall, the client refers to 6.0
OK, I changed the line of code to Dim doc As New MSXML2.DOMDocument60.
What has caused the change? and hope it works at client location...
Please be tuned!
Hi All you experts!
I have code I use for importing XML into Access. this code uses DOM document.
I yesterday wanted to run a test, and got a compile error: "User-defined type not defined". The error is on the first line of the import function:
Dim doc As New MSXML2.DOMDocument...
Glad I could help :)
Mow make sure you use the correct object in the entire code (Access VBA has other assumptions than Excel VBA, when referring to Excel from out of Excel you must always use these App->Workbook->Worksheet objects).
ATB
As far as I understand, the missing reference is a Worksheet object. I your case:
For RD = WKB.Range("AL" & WKB.Rows.Count).End(-4162).Row To 2 Step -1
(As for (-4162), It is a value from you code... ;) )
What does Rang refer to? Your code is running are in Access, you should have it refer to the worksheet Object.
Here is a link to an example of editing Excel from Access
Hi,
See here, you should have a FE file on each machine. opening a single file on a common network location can cause file corruption.
When a file gets corrupted, all sorts of weird things can happen...
ATB
Well, I mite have had a syntax error: Nz(Referral1,) is missing a parameter. I fixed it in the earlier post.
But I think you should do yourself a favour, go with CJ_London's and reconstruct you DB
How about
Nz(Referral6,Nz(Referral5,Nz(Referral4,Nz(Referral3,Nz(Referral2,Nz(Referral1))))))
if Referral6 is not null, return it, otherwize, return Referral5, etc...
BTW, just for the record, this seems to me not normalized DB structure.
ATB
No. You can query in any field order you want.
What is your goal in this section:
InStrRev([Referral1] & ("/"+[Referral2]) & ("/"+[Referral3]) & ("/"+[Referral4]) & ("/"+[Referral5]) & ("/"+[Referral6]),"/")
What error message do you get?