Are you running your code live? If so, there will be no object context.
In order to work in debug and in production, always use the following syntax with ObjectContext:
Dim ctxobject As ObjectContext
Dim objAccount As Object
Set ctxobject = GetObjectContext()
if ctxobject Is Nothing then...
To create the folder, use the FileSystemObject GetFolder and CreateFolder methods.
dim strPath as string
const strDrive="c:\"
strPath= strDrive & txtClaim.text
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder(strPath)
...
NO, data will not automatically transfer from one database to another!
1) If you are updating the code elements and maintaining the same database (and they are not the same file, e.g. a single Access database with both forms and data):
When you install a new version of your program, you also...
Your code is fine. However, it is writing the value into the Immediate window, and you can't see the window unless you switch back to the IDE and open the immediate window (from the View menu) while the program is still running.
If you want to see the result from your executable window, either...
if not objRS1.BOF then
objRS1.MoveFirst
End if
...................................
Alternatively, you could do both tasks while moving through the recordset once:
Dim iDoc as Integer, iPic as integer
Do While objRS1.EOF <> True
MyPic = UCase(objRS1("Description"))
If MyPic...
The following will work if there is always a record in plan matching the record in grantz. If not, change the word INNER to LEFT OUTER.
Change your FROM clause as follows:
JPMC37014.dbo.grantz grantz
LEFT OUTER JOIN JPMC37014.dbo.exercise exercise ON
grantz.GRANT_NUM =...
I think you have to do it with a cursor and a temp table. Retrieve all the machine numbers into your cursor, loop through it to append the top 15 rows for that machine. Then select * from the temp table.
Try this. It looks simpler:
Select A.Name, A.Points, A.Year
From tblPoints A
Inner Join (Select Max(Points) As MaxPoints, Year
From tblPoints
Group By Year) B
On B.MaxPoints = A.Points And B.Year=A.Year
Order By A.Year
If...
The indefinite hang-up in your first message was probably caused by attempting to return a recordset from an update query. Update queries don't create recordsets.
Is your table indexed on the fields in the where clause? You didn't say how long it takes to update the table if only one PC is...
Better yet, why not normalize your data? Create a new table, with fields FishId, MeasurementType, and FishLength.
(MeasurementType will identify the 4 columns you used in your current table).
Then all you need is a simple update query with a select max(FishLength).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.