The code should look like this...
Private Sub delete_record_Click()
On Error GoTo Err_delete_record_Click
If MsgBox("Are you sure you want to delete the selected record?", vbYesNo, "Delete?") = vbYes Then
Me.AllowEdits = True
DoCmd.RunCommand acCmdDeleteRecord
Me.AllowEdits = False
Else...
You can't call it from the switchboard manager, how would it know which record to reset? Or do you only have one record in the entire db? The switchboard is related to no records, it acts as the control panel for your other forms etc. It is possible to reset ALL the fields in the table from the...
Change the code to...
If MsgBox("Are you sure you want to reset the selected record?", vbYesNo, "Reset?") = vbYes Then
Me.[Rent Paid] = 0
Me.[Date Rent Paid] = ""
Else
End If
HTH
IMO
No, not the switchboard. Select one of the forms that use Rent Paid and Date Rent Paid (Like an edit accounts form) and place the button on there.
HTH
IMO
Ok, Open the form where you view the data in design view. Create a button cancelling the wizard. Right click on the button and select properties, scroll down to "OnClick" and from the dropdown select "Event Procedure". Just to the right of the drop down arrow is another button " ... " click on...
In the OnClick event of the button try...
Private Sub YourButton_Click()
Me.YourRentPaidField = ""
Me.YourDateRentPaidField = ""
End Sub
When you say "will reset fields that I select", how are you selecting the fields? With a CheckBox?
HTH
IMO
You could use the LostFocus event of the text box...
Private Sub TextBoxName_LostFocus()
Me.CommandButtonName.SetFocus
End Sub
but this will only move the focus to the button and you won't be able to tab back to the detail section.
HTH
IMO
To open the form hidden...
DoCmd.OpenForm "YourForm", acNormal, "", "", , acHidden
to hide the form after an event (LogOn)...
Me.Form.Visible = False
HTH
IMO
Place the following code in a new module changing "Sheet1" to the Sheet Name and "YourExcelWorkbook.xls" to the Name and path of the workbook...
Public Function DeleteRowAddDummyData()
Dim objXL As Excel.Application
Dim objWkb As Excel.Workbook
Dim objSht As Excel.Worksheet
Dim...
Create a query selecting the fields you want in your report. In the criteria field of the date column put...
between [Start Date] and [End Date]
get the wizard to create the report based on your query.
HTH
IMO