Hello All,
I have a search form on my db with two searches. One works fine, the 'between date' search, however, I seem to have broken. My live db works fine, but I've made a copy in order to standardize the buttons and now that my buttons are standardized I was running through everything before copying it back to live and found this problem.
It works by setting a username, start date, and end date. Click search which runs this code:
Code:
Private Sub Date_Search_Click()
DoCmd.OpenForm "Search Project Query Res", acNormal
DoCmd.Close acForm, "SelectProject", acSaveYes
End Sub
Form 'Search Project Query Res' has a query as a record source, which has a few fields, and criteria on a date field with a between statement.
What is happening is the enddate field doesn't seem to be making it through suddenly. The results form has this code:
Code:
Private Sub Form_Load()
Dim ProgNumb As Variant
Dim rsTemp As New ADODB.Recordset
ProgNumb = [Forms]![SelectProject]![cntrlProg]
rsTemp.Open "SELECT [txtEmpLastName] as LName, [txtEmpFirstName] as FName FROM tblEmployee Where [pkID] =" & ProgNumb & " ;", _
CurrentProject.Connection, adOpenStatic, adLockReadOnly
Me.NameBox = rsTemp("FName") & " " & rsTemp("LName")
Me.SDate = [Forms]![SelectProject]![SDate]
Me.EDate = [Forms]![SelectProject]![EDate]
If Me.SearchRes.ListCount = 0 Then
Me.Label13.Caption = "No Records found for "
Me.Label13.Width = 2016
Me.NameBox.Left = 2580
Me.btnClose.Visible = True
Me.btnTry.Visible = True
End If
End Sub
And so the results form displays with no reuslts and NO END DATE. I put a msgbox in to show the [Forms]![SelectProject]![EDate] and it errors out with a null. I have looked thoroughly at [SelectProject]![EDate], flipping back and forth between properties for it and SDate and can find no differences.
Can anyone give any pointers at where I might look to find the problem?
Thanks,
Ken