Results 1 to 6 of 6
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 7 64bit Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    Next button create new records.


    I have various Input forms, i.e. Employees, Customers and Suppliers. Attached you will see an image of the Bank Branch input form. All of them work the same. On this BankBranch form when I click on the Next button it creates a new record. I looked at the VBA and found no reason, none of the other forms does it. What can it be?

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Likely a form property is different; such as Cycle or Allow Addtions. Suggest you check them all. If that doesn't help, post the relevant code and maybe pics of those properties from the property sheets from 2 different forms.
    But no picture in your post...
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Perfac's Avatar
    Perfac is offline Expert
    Windows 7 64bit Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Click image for larger version. 

Name:	BankBranch.png 
Views:	23 
Size:	215.5 KB 
ID:	33528
    Dont waste much time reading the VBA. I replaced the "NEXT" button. There was on load event to set allow additions and deletions to "No" then an enable button to enable it when needed. I removed it. Do you know if "Allow additions" and "Allow Deletions" is set to no. The selection box at the top also is effected. Is it possible to have Add and Del of but the Selection box still working?

    Option Compare Database


    Private Sub Check010_Click()
    Me.T026.Visible = Not Me.Check010
    Me.T027.Visible = Not Me.Check010
    Me.T028.Visible = Not Me.Check010
    Me.T029.Visible = Not Me.Check010
    Me.T030.Visible = Not Me.Check010
    Me.Same.Visible = Me.Check010
    End Sub


    Private Sub Check008_Click()
    If Check008.Value = True Then
    Me.T003 = 77
    Me.T016.Visible = True
    Me.T017.Visible = True
    Else
    Me.T003 = 80
    Me.T016.Visible = False
    Me.T017.Visible = False
    End If
    End Sub


    Private Sub Check011_Click()
    If Me.Check011.Value = True Then
    Me.T015.Visible = True
    ElseIf Me.Check011.Value = False Then
    Me.T015.Visible = False
    End If
    End Sub


    Private Sub Command204_Click()
    AllowEdits = True
    AllowDeletions = True
    End Sub


    Private Sub Form_Current()
    If Me.Check010 = -1 Then
    Me.T026.Visible = False
    Me.T027.Visible = False
    Me.T028.Visible = False
    Me.T029.Visible = False
    Me.T030.Visible = False
    Me.Same.Visible = True
    Else
    Me.T026.Visible = True
    Me.T027.Visible = True
    Me.T028.Visible = True
    Me.T029.Visible = True
    Me.T030.Visible = True
    Me.Same.Visible = False
    End If
    Me!LdgAcc_ID01 = IIf(Check008.Value = True, 77, 80)
    If Me.Check011.Value = True Then
    Me.T015.Visible = True
    ElseIf Me.Check011.Value = False Then
    Me.T015.Visible = False
    End If
    If Check008.Value = True Then
    Me.T003 = 77
    Me.T016.Visible = True
    Me.T017.Visible = True
    Else
    Me.T003 = 80
    Me.T016.Visible = False
    Me.T017.Visible = False
    End If
    If Not IsNull(Me.Logo01) Then Me.LogoImage01.Picture = Me.Logo01
    If Not IsNull(Me.Photos01) Then Me.PhotoImage01.Picture = Me.Photos01
    End Sub


    Private Sub Form_Load()
    DoCmd.Maximize
    If Me.Check011.Value = True Then
    Me.T015.Visible = True
    ElseIf Me.Check011.Value = False Then
    Me.T015.Visible = False
    End If
    End Sub


    Function Openword(conPath As String)
    Dim appword As Word.Application
    Dim doc As Word.Document


    On Error Resume Next
    Error.Clear
    Set appword = GetObject(, "word.application")
    If Err.Number <> 0 Then
    Set appword = New Word.Application
    appword.Visible = True
    End If
    Set doc = appword.Documents.Open(conPath, , True)
    appword.Activate


    Set doc = Nothing
    Set appword = Nothing


    End Function


    Private Sub Cmd01_Click()
    Dim mydoc As String
    mydoc = "c:\50 DiBiDocs\WordDocsInDIbi\0010 BankBranch.docx"
    Call Openword(mydoc)
    End Sub

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Do you know if "Allow additions" and "Allow Deletions" is set to no.
    Don't know how you expect anyone here to know that without looking at your property sheet.

    Is it possible to have Add and Del of but the Selection box still working
    The grammar is a bit baffling to me. I don't know how to interpret that.

    Regarding your code, please use code tags with suitable indentation for anything more than a few lines. Without that, your code is difficult to read, believe it or not. If I see something like this in a first post, I'll often bypass the thread.

    Suggest you look into adopting a naming convention as not only is it pretty much impossible for us to follow (Me.Check008 means nothing to us), you will find it problematic when reviewing your own code in the future:
    One source about how to name things - http://access.mvps.org/access/general/gen0012.htm
    What not to use in names - http://allenbrowne.com/AppIssueBadWord.html

  5. #5
    Perfac's Avatar
    Perfac is offline Expert
    Windows 7 64bit Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Thank you. English is not my first language but I thought it wasn't too bad. I understand you well about naming convention and I am keen to make better decisions about it. I am at any time willing to post my Dbase and keen to display the proerty sheet, I will do that here.
    Click image for larger version. 

Name:	BankBranch2.png 
Views:	14 
Size:	136.4 KB 
ID:	33542

  6. #6
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Your English is so good that I was fooled into thinking it was a an English speaking person who got tripped up in their grammar . Certainly your English is better than any other language I speak since my only other tounge is Pig Latin.

    You are posting your db in another post?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 11-15-2017, 10:44 AM
  2. Replies: 3
    Last Post: 05-22-2014, 09:23 AM
  3. Replies: 2
    Last Post: 05-28-2013, 04:00 PM
  4. Replies: 1
    Last Post: 02-16-2013, 11:36 AM
  5. Replies: 3
    Last Post: 11-27-2012, 07:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums