Joshua61679
Technical User
Hello all,
Just spent another day fighting a runtime error, and I give up. This is the code I am using:
Private Sub OpenHole_Click()
Dim strCutomer As String
Dim strLease As String
Dim strDate As String
Dim strWhere As String
strCustomer = Me!Customer
strLease = Me!OpenHole.Column(0)
strDate = Me!OpenHole.Column(2)
strWhere = " Customer = '" & strCustomer & "' AND " _
& " Lease = '" & strLease & "' AND Date = '" & strDate & "'"
Call DoCmd.OpenForm("Open", , , strWhere, acFormEdit)
End Sub
Well, kind of, I've only got 2 lines for the strWhere, so I'm not really mising a line connector there.
At anyrate, I'm getting a 2501 runtime error, I believe relating to the date portion of the strWhere line. Any ideas why? (Both the Me!OpenHole.Column (2) and the Form!Open!Date field are date formatted if that makes a difference.) Thanks in advance for any help.
Joshua
Just spent another day fighting a runtime error, and I give up. This is the code I am using:
Private Sub OpenHole_Click()
Dim strCutomer As String
Dim strLease As String
Dim strDate As String
Dim strWhere As String
strCustomer = Me!Customer
strLease = Me!OpenHole.Column(0)
strDate = Me!OpenHole.Column(2)
strWhere = " Customer = '" & strCustomer & "' AND " _
& " Lease = '" & strLease & "' AND Date = '" & strDate & "'"
Call DoCmd.OpenForm("Open", , , strWhere, acFormEdit)
End Sub
Well, kind of, I've only got 2 lines for the strWhere, so I'm not really mising a line connector there.
At anyrate, I'm getting a 2501 runtime error, I believe relating to the date portion of the strWhere line. Any ideas why? (Both the Me!OpenHole.Column (2) and the Form!Open!Date field are date formatted if that makes a difference.) Thanks in advance for any help.
Joshua