WHERE ((([tbl_LIST OF CREWS].TRADE)=[Forms]![frm_select_trade]![cboTrade]) AND (([OMNIS_f_Job_Library].FO_JOB_CODE)=[Forms]![frm_supervisor_sort]![cboTASKCODE])) OR ([Forms]![frm_supervisor_sort]![cboTASKCODE]="*")
This returns all task codes when * is selected in cboTASKCODE, but it also...
The union query is the Row Source of the combo box (cboTASKCODE)in a form (frm_supervisor_sort). Not sure what to tell you about ODBC tables. When Like"*" is typed manually into the criteria, the correct records are returned. Sorry the SQL view is so long. The fields come from several...
I am attempting to create a select all option in a combo box. I have created a union query with the following code:
SELECT "*" AS Task_Code, "(All)" AS Description, "(All)" AS Trade
FROM tbl_Taskcode
UNION SELECT tbl_Taskcode.Task_code, tbl_Taskcode.Description, tbl_Taskcode.Trade
FROM...
Can you not have a parameter in the recordset? I have the form open and the 'Trade' selected in the combo box (cboTrade). Both queries work properly as long as the frm_select_trade is open and a trade has been selected.
Private Const conQuery = "SELECT Count(qry_planning_report.WO_NUMBER)AS CountOfWO_NUMBER, qry_planning_report.FU_BLDGCODE_DUP FROM qry_planning_report GROUP BY qry_planning_report.FU_BLDGCODE_DUP ORDER BY Count(qry_planning_report.WO_NUMBER) DESC;"
Now the error message says:
"No value given...
I have a query (qry_count_buildingcode). It returns the number of work orders for each building. This query gets its fields from another query. Although 'qry_count_buildingcode' returns two simple columns of data ('Count of work orders' and 'Building Name'), I cannot make Access automatically...
I have a form where the user selects criteria such as 'builidng name'from a combo box. The criteria is used in a query to show work orders for the building selected. I would also like to give the user the option of viewing all buildings at once. Can I include a 'Select All' option in the...
CMP,
qry_count_buildingcode opens without error. It returns two columns: one with the name of the building and one with the count of the number of work orders for that building.
You were right!! Do you think it has to do with the connection?
When I pass my cursor over the last line this box appears:
'CurrentProject.Con...="Provider=Microsoft.Jet.OLEDB.4.0,
User ID=Admin;Data...'
I copied the tbls,queries,module etc. from the sample database and tried to run the code...
I need to sort my work order report by listing the building with the most number of work orders first.
The report is sorted by date next.
I made a query to count the number of work orders for each building. Then I told the report to sort by this 'count' and then by date.
This works until two...
It never goes to debug mode. After clicking OK on the error message, it returns to screen with nothing highlighted. I'm not familiar with 'underlaying SQL code. Where do I look?
I changed the name of the module from 'CreateExcelChart' to 'ExcelBuilding'.
Now the error message is
-2147217900: Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', OR 'UPDATE'.
Option Compare Database
Option Explicit
Private Const conQuery = "qry_count_buildingcode"
Private Const conSheetName = "WO by building"
Public Sub CreateExcelChart()
Dim rst As ADODB.Recordset
' Excel object variables
Dim xlApp As Excel.Application
Dim xlBook As...
I have created a form with a command button that has the following code:
Private Sub cmdXL_Click()
Call CreateExcelChart
End Sub
There is a module called CreateExcelChart. The module is public and should be run when you click on the command button.
The following error message appears...
I have a query that is composed of fields from several tables. Occasionally, a record will not have data for one or two of the fields in the query. If this is the case, the record is not returned when the query is run. It's not that the field for that record is just blank, it doesn't even...
I have successfully used VBA code to print two different reports at one time. Sometimes, however, both reports are not applicable to the field chosen and I end up just printing blank reports. Is there a way to automatically cancel the printing of a report if no records exists for a particular...
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.