Hey Skip,
thanks a lot for the input.
As I needed a dynamic way of adapting the connection- and SQL-strings of all querytables to the path where the workbook is opened from, I've applied the following solution:
Created 3 functions to update the conn-string, SQL-string and refresh the...
done. and thanks a million so far!
Martin
Typos, that don't affect the functionality of code, will not be corrected.
Martin Serra Jr.
www.mserrasystems.eu
Database_Systems and _Applications shared across all Business_Areas
Hi again,
my question was:
extremely enlightening answer from SkipVought was:
Many thanks, Skip so far!!
I will not post the whole result of the two function in here (business privacy) .... but here are two neutralized examples (one for the connection string, one for the SQL) that show...
Hey,
I have a question on the FAQ
faq68-5829 by SkipVought.
I'm using the exact technique Skip is describing for building a little reporting tool in Excel. My problem is, that when the Excel workbook that contains the data source and the queries is moved to another location (e.g. forwarded by...
something like
SELECT TYPES.NAME, COUNT(SCHEDULE.TYPE)
FROM TYPES LEFT JOIN SCHEDULE ON SCHEDULE.TYPE = TYPES.ID
WHERE (SCHEDULE.DATE Between #1/1/2005 And #10/1/2005#) OR SCHEDULE.TYPE IS NULL
GROUP BY TYPES.NAME
HTH,
fly
Typos, that don't affect the functionality of code, will not be...
dear colleagues,
this is off topic, but I'm gonna fly to Chicago, IL, tomorrow and be in Deerfield, IL, until next friday (Sep, 16)
... business travel ...
anyone of the tek tips coreteam send me a note if there is an opportunity to meet ...
Best regards,
Martin
Typos, that don't affect the...
Good [morning]
imho there are scenarios where it can make sense to change the query slq via VBA, e.g. if you don't want user interaction and grab the criteria from somewhere automatically ...
WaltW: using the search function is always recommended.
here is the answer to your particular...
should be no problem, but why not simply use a query with a calculated field?
iif(Field1 = number; calculation1) as newfield
HTH,
fly
Typos, that don't affect the functionality of code, will not be corrected.
Martin Serra Jr.
www.mserrasystems.com
Database_Systems and _Applications shared...
SELECT Company, Max([Date]) AS Latest_Date
FROM summary
Group BY Company;
You should avoid using reserved words (like "Date") as field names in your tables!
HTH,
fly
Typos, that don't affect the functionality of code, will not be corrected.
Martin Serra Jr.
www.mserrasystems.com...
as far as I see this can only be done with VBA:
Function testsplit()
Dim db As DAO.Database
Set db = Application.CurrentDb
Dim rs As DAO.Recordset
Set rs = db.OpenRecordset("tbl_TestSplit")
Dim ary
ary = Split(rs.Fields(1).Value, ";")
rs.MoveLast
rs.MoveFirst
Do Until rs.EOF
Debug.Print...
in the access menubar go to tools->startup ...
in the "display form/page" combobox select your form.
this will open your form on startup of the DB.
HTH,
fly
Typos, that don't affect the functionality of code, will not be corrected.
Martin Serra Jr.
www.mserrasystems.com
Database_Systems and...
Hi jwruble,
don't know of a way to always show the scrollbars of a textbox, but the additional text to be displayd if the text in the box is longer than a certain number of characters, is easy:
add a label on your form like "theres more to read ..."
find out the number of characters, that can...
like that?
SELECT max(dbo.Actions.ActionDT), Last(dbo.Invoices.InvoiceID)
FROM dbo.Invoices INNER JOIN
dbo.Actions ON dbo.Invoices.InvoiceID = dbo.Actions.InvoiceID
GROUP BY dbo.Invoices.InvoiceID
ORDER BY dbo.Actions.ActionDT ASC, dbo.Invoices.InvoiceID ASC;
HTH,
fly
Typos...
like that?
rs2.FindFirst "acctnmbr_out= '" & rs1!AcctNmbr_Out & "' And rectype_out = ""01""" 'FIND First 01 REc
this is assuming acctnmbr_out and rectype_out both are stings
HTH,
fly
Typos, that don't affect the functionality of code, will not be corrected.
Martin Serra Jr...
are you referring to modifications on table properties or the data in the table?
the date and time when the properties of a table have been modified can be found with something like:
Function dateupdated()
Dim db As DAO.Database
Set db = Application.CurrentDb
Dim tdf As DAO.TableDef
Set tdf =...
1. the WHERE clause should be before the ORDER BY clause.
2. to get the value of the cbobox on the subform use:
[Forms![frmJobRep]![sfmJobRepDet]!cboManuf.value
with [sfmJobRepDet] being the Name of the subform-control.
HTH,
fly
Typos, that don't affect the functionality of code, will not be...
i've tested the a.m. code, and it worked ...
Good luck,
fly
Typos, that don't affect the functionality of code, will not be corrected.
Martin Serra Jr.
www.mserrasystems.com
Database_Systems and _Applications shared across all Business_Areas
...left and right part of the existing SQL ...
something like
strSQL = Left(qdf.Sql, InStr(qdf.Sql, "WHERE") - 1) & _
" WHERE yourCritField Like ""*yourCritVal*"" " & _
Right(qdf.Sql, Len(qdf.Sql) - InStr(qdf.Sql, "GROUP") + 1)
Just a thought,
fly
Typos, that don't affect the functionality...
in your query:
... WHERE [incident number] = Forms!yourForm!txt_Incident_Number
txt_Incident_Number is the name of the control, that holds the incident number to be pulled by the query.
HTH,
fly
Typos, that don't affect the functionality of code, will not be corrected.
Martin Serra Jr...
you can edit the SQL of a saved query via VBA as follows:
Dim strSQL as String
Dim db as DAO.Database
Dim qdf as DAO.Querydef
Set db = Application.CurrentDB
set qdf = db.Querydefs("yourSavedQueryName")
strSQL = "SELECT ... FROM ... WHERE ....;"
qdf.SQL = strSQL
HTH,
fly
Typos, that don't...
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.