Page 9 of 9 FirstFirst 123456789
Results 121 to 132 of 132
  1. #121
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    yep its knop179

    im also trying to make the form printa additional report (only on dataentrymode), but it doesnt work hehe, any ideas on what im doing wrong?


    Code:
    If Me.NewRecord = True Then    'data entry mode
        DoCmd.OutputTo acOutputReport, "rptCurrentGeneesmiddel", acFormatPDF, FilePath, False
        DoCmd.OpenReport "rptNewproductchecklist", acNormal
        
    Else

  2. #122
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Can you upload your latest file(s)?
    If you haven't done much else you can replace the Geneesmiddelbewerkformulier form module with the one included below and try it:

    Code:
    Option Compare Database
    Option Explicit
    Dim boNewRecord As Boolean
    Private Sub Form_BeforeUpdate(Cancel As Integer)
    
    
    If boValidateEntries = False Then
      Cancel = True
      Me.Geneesmiddel.SetFocus
    End If
        
    End Sub
    
    
    Private Function boValidateEntries() As Boolean
    boValidateEntries = True
    If IsNull(Me.Geneesmiddel + Me.KNMPNummer + Me.Uiterlijk + Me.Vorm + Me.HoudbaarheidKoertGDS + Me.Ingevoerd_door) = True Then
      MsgBox "Niet alle velden zijn ingevuld!"
      boValidateEntries = False
      Exit Function
    End If
    End Function
    Private Sub Form_BeforeInsert(Cancel As Integer)
    'Vlad Jan 8 -2019 - you missed these changes
    If IsNull(Me.Ingevoerd_door) Then Me.Ingevoerd_door = DLookup("[Username]", "[usysSettings]") 'vc Dec7, 2018
    'Vlad Jan 8 -2019 - you missed these changes
    End Sub
    Private Sub Form_Close()
    DoCmd.OpenForm "FrmHomescreenAdmin"
    End Sub
    
    
    Private Sub Form_Current()
    If Me.NewRecord = True Then
        boNewRecord = True
    Else
        boNewRecord = False
    End If
    End Sub
    
    
    Private Sub Form_Open(Cancel As Integer)
    Me.Geneesmiddel.SetFocus
    'Me.Ingevoerd_door = DLookup("[Username]", "[usysSettings]") 'Vlad Jan 8 -2019 - you missed these changes
    End Sub
    
    
    Private Sub Knop179_Click()
    If vcEncrypt(InputBoxDK("Please enter your password", "Password needed"), 191878912) = DLookup("[Password]", "usysSettings") Then
    Me.Dirty = False
    DoCmd.PrintOut acSelection
    'DoCmd.RunCommand acCmdSaveRecord
    Dim FileName As String
    Dim FilePath As String
    
    
    If boValidateEntries = False Then
         Me.Geneesmiddel.SetFocus
         Exit Sub
    End If
    
    
    FileName = Me.Geneesmiddel & Me.Id
    FilePath = "C:\Users\managergal\Desktop\printscreens\" & FileName & "_" & Format(Date, "DD_MMM_YYYY") & ".pdf"
    
    
    'Vlad Jan 8 -2019 - you missed these changes
    'DoCmd.OutputTo acOutputReport, "rptCurrentGeneesmiddel", acFormatPDF, FilePath, False
    
    
    'If Me.NewRecord = True Then 'newrecord gets canceled by the Me.dirty=false above
    If boNewRecord = True Then
        'data entry mode
        DoCmd.OutputTo acOutputReport, "rptCurrentGeneesmiddel", acFormatPDF, FilePath, False
        DoCmd.OpenReport "rptNewproductchecklist", acNormal 'March 9, 2019
    Else
        'edit mode
         DoCmd.OutputTo acOutputReport, "rptCurrentGeneesmiddel", acFormatPDF, FilePath, False
    End If
    'Vlad Jan 8 -2019 - you missed these changes
    MsgBox "Wijzigingen opgeslagen en versiegeschiedenis geupdate"
    DoCmd.Close acForm, Me.Name
    Else
        MsgBox "Sorry, wrong password, please try again", vbCritical
    End If
    
    
    
    
    End Sub

  3. #123
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    https://drive.google.com/open?id=1KF...xRJwJe976MtLGH
    newest version.

    i added the changes you made but it doesnt print, close nor open the homescreen afterwards.. it does save it though.

  4. #124
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Sorry, I am going away in vacation for two weeks and won't be able to look at your db. Maybe you can put some brakes on the code and see where the problems are?

    Cheers,
    Vlad

  5. #125
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    Quote Originally Posted by Gicu View Post
    Sorry, I am going away in vacation for two weeks and won't be able to look at your db. Maybe you can put some brakes on the code and see where the problems are?

    Cheers,
    Vlad
    if i delete this part of the code it works fine:
    Code:
    If boValidateEntries = False Then     Me.Geneesmiddel.SetFocus
         Exit Sub
    End If
    but then it wont validate the entries right?

  6. #126
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Did you add the variable declaration at the top of the module?

  7. #127
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    Quote Originally Posted by Gicu View Post
    Did you add the variable declaration at the top of the module?
    yeah, i copypasted your code.
    another issue: the geneesmiddelbewerkformulier wont open in ''edit'' mode to the record thats selected in the overzichtstabellistform, it just opens blank.

    https://drive.google.com/open?id=1KF...xRJwJe976MtLGH
    Last edited by farmi; 03-28-2019 at 10:51 AM.

  8. #128
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Sorry, I am still away in vacation and I don't have a laptop with me,back later next week.

  9. #129
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    okay i guess ill wait then

  10. #130
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Have a look now. I tried to add a new record and if all required fields are filled in it prints the report. I also changed the form's dataadd property to false for the Geneesmiddelbewerkformulier (that was the reason you couldn't go to the selected record in the other).

    Cheers,
    Vlad
    Attached Files Attached Files

  11. #131
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    Im tryinng to make a superadmin menu, so to add another layer of security. In which the superadmin has another form to add, edit and delete users. Maybe like an extra button in the homescreenadmin called user management or something.
    How would i go about this? can i just add a level 3 layer in the table for the users and make a form to edit the users?

  12. #132
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    I would just use the usertype field in tblUser. When opening the homescreenadmin do a dlookup for that field and if the value is "superuser" then make the new button visible (to open the new user editing form).

    Cheers,
    Vlad

Page 9 of 9 FirstFirst 123456789
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Inventory System in Access
    By Antonww in forum Access
    Replies: 6
    Last Post: 11-29-2017, 06:35 AM
  2. Need Help:Basic Inventory System
    By shazi9b in forum Access
    Replies: 5
    Last Post: 09-26-2013, 12:48 AM
  3. An inventory system
    By stew8908 in forum Access
    Replies: 3
    Last Post: 05-08-2012, 05:50 PM
  4. Inventory System
    By Rawb in forum Database Design
    Replies: 8
    Last Post: 01-05-2011, 07:26 AM
  5. Replies: 1
    Last Post: 12-30-2008, 08:58 PM

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