简体   繁体   中英

Unable to make Ms Access form blank to enter new records

I have a problem. When I open the Ms Access form to enter new records, it is showing old records. I need it to show a blank form, I have tried me.Refresh, me.Requery and call DoCmd.GoToRecord(,, acNewRec)

What else can i try?

The call DoCmd.GoToRecord(,, acNewRec) line is producing an error: ' a problem occured while Ms Access was communicating with the OLE server or ActiveX control"

Private Sub Form_Load()
    'me.Requery
    'me.Refresh
    Call DoCmd.GoToRecord(, , acNewRec)
    If Not IsNull(Me.SubjectID) Then
        Forms!Data_Pro_Patient_Entry![my_rep].Visible = True
        Call Disable_Schedule_Generation
    Else
        Forms!Data_Pro_Patient_Entry![my_rep].Visible = False
        Call generate_auto_id
    End If
End Sub

if you're opening the form from code, add "acFormAdd" to data DataMode like

docmd.OpenForm {FormName},acNormal,,,acFormAdd

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM