Code: Me.txtEmpID = DLookup("EmpID", "PiecePay", "EmpID='" & txtEmpID & "'")I would also like to have a field called PieceDate equal to txtPieceDate.
Code: Select EmpID From PiecePay Where EmpID = txtEmpID AND PieceDate = txtPieceDateHow would I do that with DLookup? I've tried it different ways. My problem is probably with my use of the double and single quotes.
Code: If IsNull(DLookup("ExchRate", "TBL_DDPExchRates", "CurID = " & Me.Combo4 & " AND ExchDate = #" & Me.ShipOBDate & "#")) And Me.Combo4 2 ThenIt seems that if ShipOBDate is any date between the first and tenth of the month the DLookup fails to locate the appropriate record. I can't understand why as ShipOBDate and ExchDate are both formatted as Short Date and ExchDate is being populated via an OpenArgs which is derived form the field ShipOBDate
Code: Dim db As Database Dim rs As Recordset Dim Criteria As String Set db = CurrentDb Set rs = db.OpenRecordset("tblCalendarEvents") Criteria = "[date_of]=#" & ctldate & "# AND [sbjID]='" & strSbjID & "' AND [choices]='" & strChoice & "'" rs.FindFirst CriteriaI'm getting the error 3251
DoCmd.OpenForm "Purchasing_PRC2_withoutInvoice_form", View:=acFormDS, wherecondition:="Transactions.PRC2DocID Is Null And DocRec.[Class Code]=100 and [Date of Record] between #" & Forms!MonthReportPreparation_OTPS.startdateparOTPS & "# and #" & EndOfMonth(Forms!MonthReportPreparation_OTPS.startdateparOTPS) & "#"I tried putting the first two items in the where condition (the 'Transactions.PRC2DocID Is Null And DocRec.[Class Code]=100' parts) into the sql query itself, and leaving only the date criteria in this vb line, but that doesn't work either. All the field names exist and are spelled correctly.
Would anyone be able to tell me why docmd.openform works with a single where criteria but asks for parameters input with multiple criteria?
Code: Docmd.OpenForm "LOG SHEET - ORDERS", acNormal, "", "[CustomerName]=" &" '" [&CustomerName] & "'", , acNormalbut can I expand this to another criteria? (no!).