Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Gfunk13

  1. Gfunk13

    Clear All Filters in Access 2007

    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...
  2. Gfunk13

    Open form to record for date from another form

    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...
  3. Gfunk13

    Problem hiding button on Form_Current event

    Thanks guys. This worked: If Me!ProdDate = VBA.Date Then
  4. Gfunk13

    Problem hiding button on Form_Current event

    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...
  5. Gfunk13

    Error 3061 for DatePart in criteria of recordset

    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...
  6. Gfunk13

    Form control SQL syntax in recordset

    Thanks Aceman! Worked great.
  7. Gfunk13

    Form control SQL syntax in recordset

    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 =...
  8. Gfunk13

    ActiveX calendar for record navigation

    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...
  9. Gfunk13

    Recordset syntax Error 3061

    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...
  10. Gfunk13

    Recordset syntax Error 3061

    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...
  11. Gfunk13

    Setting textbox value after updating a different textbox

    It is enabled and not locked. I do not have a control source assigned, but I can type a value into the field.
  12. Gfunk13

    Setting textbox value after updating a different textbox

    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")
  13. Gfunk13

    Setting textbox value after updating a different textbox

    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...
  14. Gfunk13

    SQL statement in VBA code to populate form text box

    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...

Part and Inventory Search

Back
Top