jim may
Well-known Member
- Joined
- Jul 4, 2004
- Messages
- 7,486
I create a Form based on a query - Added a Command button to allow a New record to be added. It worked fine for a month or two, until I CHANGED something - to where now when I open the Form and Click on the Add New Record button, nothing happens -- At the bottom of the form I can see that the native "add new record" is greyed out. The user wanted the Records to be maintained in Alphabetic order (based on a calculated field combining the Church Name and City) which I did -- Everything works fine except when I need to add a new record. Can I modify the code below to use another query when I need to add new records? HELP!!!
Code:
Private Sub Command120_Click()
On Error GoTo Command120_Click_Err
On Error Resume Next
DoCmd.GoToRecord , "", acNewRec
ChurchName.SetFocus
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If
Command120_Click_Exit:
Exit Sub
Command120_Click_Err:
MsgBox Error$
Resume Command120_Click_Exit
End Sub