Full Version: CSR Edit Form
UtterAccess Forums > Microsoft® Access > Access Forms
Karol
I have a form so the manager can go in and actually pull up the CSRs data for the day and make changes to the actual table for corrections. So in order to do this I have a calendar on the form MSCAL.Calendar.7 and a drop down from another table called CSR. I also have a GO button and behind it I have the following code:
Private Sub GoButton_Click()
Me.RecordSource = "tblBroker"
Form_PersonalReport.Filter = "LogDate Between #" & Format(Calendar2, "mm/dd/yyyy") & "# And #" & Format(DateAdd("d", 1, Calendar2), "mm/dd/yyyy") & "#"
Form_PersonalReport.FilterOn = True
Me.Filter = "LogDate>=#" & Format(Calendar2, "mm/dd/yyyy") & "#"
Me.FilterOn = True
For the calendar I have the following code:
Private Sub Form_Load()
Me!Calendar2.Month = Month(Date)
Me!Calendar2.Year = Year(Date)
Me!Calendar2.Day = Day(Date)
End Sub
For the drop down that supplies the names of the CSR I have the following code:
Private Sub Combo20_Filter_AfterUpdate()
Me.Combo20_Filter.Requery
End Sub
My problem. I am getting the date but the Correct CSR name is not coming up within the form. Do I have the wrong code behind the after update event for the drop down? What do I need so the data for a CSR once selected and the date selected from the calendar will appear within the form?
Karol
I am still trying to figure this out. I am now getting a runtime error on my code behind the "GO' button. Here is what I have:
Private Sub GoButton_Click()
Me.RecordSource = "tblBroker"
Form_CSREdit.Filter = "LogDate=#" & Format(Calendar2, "mm/dd/yyyy") & " and Name=" & Nz(Me.Combo20_Filter, 0) & "#"
Form_CSREdit.FilterOn = True
Me.Filter = "LogDate>=#" & Format(Calendar2, "mm/dd/yyyy") & "#"
Me.FilterOn = True
The runtime error indicates a syntax error in the "LogDate=#' & Format(Calendar2,'mm/dd/yyy") & and Name="& NZ(Me.Combo20_Filter,0) & "#"
Please advise.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.