I have a related situation.
The Report_Close event contains the code above. When I close the report and remove the filter on the form, I want the report to return all unfiltered data when I run the report again.
It keeps returning filtered data. If the filter is changed, it reflects this...
I have a button on one form that closes the current form and opens a new one. I would like the new form to open and go directly to the record with the same date as the record that was open on the previous form when the button was pushed.
GoToRecord requires a specific pre-determined date or...
The code below hides btnNxt whether ProdDate is today or not:
Private Sub Form_Current()
If Me!ProdDate = Date Then
Me!btnNxt.Visible = False
Else
Me!btnNxt.Visible = True
End If
On another form, I am using the following code which works fine:
Private Sub...
The following is giving me a syntax error (Error 3061: Too few parameters. Expected 1.)
Set rst = dbs.OpenRecordset("SELECT Sum(Ahrs)+Sum(Bhrs)+
Sum(Chrs) AS Expr2 FROM Production
WHERE (((DatePart('m',[proddate]))=DatePart('m',Forms!PROD_Main!Text21)));")
The problem is in...
The following code is giving me error 3061 (Too few parameters. Expected 1.)
Dim dbs As Database, rst As DAO.Recordset
Set dbs = CurrentDb
Set cld = Me!Classified
Set rst = dbs.OpenRecordset("SELECT [classdate],
Sum(quantity) AS Expr1
FROM Classification " _
WHERE ClassDate =...
My goal is to click on the ActiveX calendar control and have the form move to the record the date selected.
It currently changes the value in the textbox has the same control source as the calendar. I want it to find the record with that date, rather than modify the date for the current...
Thanks Remou and PHV.
Lot_Num is a Text field (Num is misleading:))
I tried both and now I am getting run-time 3464 (data mismatch in criteria expression.
I removed the single quotes in the PHV suggestion, but still received the error.
This was my most recent attempt (without success):
Set...
I am getting a Run-Time error 3061 (Too few parameters. Expected 1) on this:
Set rst1 = dbs.OpenRecordset("SELECT Lot_Num, Origin AS Expr1 , Matrl_Class AS Expr2
FROM [Raw_Matrl_Receipt_Table]
WHERE (([Lot_Num] = Me![LOT #])))
I have tried modifying the WHERE clause in every way I can think...
Thanks PHV, I commented out all of my previous code and tried:
Me!MTDhrs = Nz(DSum(Nz(Ahrs,0)+Nz(Bhrs,0)+Nz(Chrs,0), "Production", "Month(proddate)=Month(Now())"), 0)
but I got the same error.
---
To answer the question about the highlighted in debug:
mtd.Value = rst("Expr2")
After updating a textbox, I am attempting to run this code to update a seperate textbox:
Dim dbs As Database, rst As DAO.Recordset
Set dbs = CurrentDb
Set mtd = Me.MTDhrs
Set rst = dbs.OpenRecordset("SELECT Sum(Ahrs)+Sum(Bhrs)+
Sum(Chrs) AS Expr2 FROM Production
WHERE...
I am trying to use the following to populate a form text box:
Dim sqlLot As String
sqlLot = "SELECT val(lot_num]) AS NewLot FROM
Raw_Matrl_Receipt_Table
GROUP BY Raw_Matrl_Receipt_Table.Lot_Num
HAVING (((Raw_Matrl_Receipt_Table.Lot_Num) Is Not Null))ORDER BY Val([lot_num]) DESC';"
If...
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.