DLOOKUP Run-Time error 2001 'You cancelled the previous operation' - ms-access
This is a discussion on DLOOKUP Run-Time error 2001 'You cancelled the previous operation' - ms-access ; Can someone tell me what's wrong with this simple piece of code? Private Sub Command0_Click() Dim fanswer As String Dim fMonth As String Dim fYEAR As String Dim billc As Double fMonth = DatePart("m", DTPicker1) fYEAR = Right(DTPicker1, 2) If ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| Private Sub Command0_Click() Dim fanswer As String Dim fMonth As String Dim fYEAR As String Dim billc As Double fMonth = DatePart("m", DTPicker1) fYEAR = Right(DTPicker1, 2) If Len(fMonth) = 1 Then fMonth = "0" + fMonth End If fanswer = Nz(DLookup("[B_FiscalYr]", "Budget", _ "[CustomerID] = '" & fMonth & "' and [B_Year] = '" & fYEAR & "' and [B_Billing_Code] = " & billc), "N/A") MsgBox fYEAR MsgBox fMonth MsgBox billc If fanswer = "N/A" Then fMonth = "" fYEAR = "" MsgBox " Fiscal Year Not Available" DoCmd.GoToControl "DTPicker1" End If PFiscal = Nz(fanswer, "00-00") End Sub |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 02:34 AM.




Linear Mode