Page 5 of 9 FirstFirst 123456789 LastLast
Results 61 to 75 of 132
  1. #61
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    Quote Originally Posted by Gicu View Post
    Can you upload your file to see what you mean for the searches? You can add form validation (to prevent new record creation if incomplete) in the BeforeUpdate event of the form (it has a Cancel argument to set to True to cancel the save: https://msdn.microsoft.com/en-us/vba...e-event-access
    Cheers,


    Vlad
    i used:
    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)If Len(Me.ChargenummerVerpakking & Me.Keuzelijst232 & Aantaldoosjes & Unitsperdoosje & HoudbaarheidOrigineleverpakking & vbNullString) = 0 Then
      MsgBox "Niet alle velden zijn ingevuld!"
      Cancel = True
      Me.ChargenummerVerpakking.SetFocus
    End If
    
    
    End Sub
    if i try to save without all fields occupied i get the correct message boxes but then I get an error on this:
    Code:
    Private Sub Knop296_Click()DoCmd.RunCommand acCmdSaveRecord
    End Sub
    it looks like when the event is cancelled it automatically jumps to the error module of the vba, how to prevent this? i tried this but that doesnt work either:

    Code:
    Private Sub Knop296_Click()DoCmd.SetWarnings False
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.SetWarnings True
    End Sub
    me. dirty doesnt work either..

    -when i enter a correct barcode(the scanner enters the numbers and presses enter) i still get the msgboxes,is there a way around this?

    https://drive.google.com/open?id=1BM...HJY0AOIvR8dK0E
    Last edited by farmi; 07-10-2018 at 06:50 AM.

  2. #62
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    bump

  3. #63
    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 at the attached file(s).

    Cheers,
    Vlad
    Attached Files Attached Files

  4. #64
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    thanks.

    is it possible to use the record id field to jump to a specific record?
    Edit:
    ive been looking at some videos online.
    Maybe it would be better if i used a listform and create a go to record button right? and maybe include a search in that form aswell.(how to make one better than the one in the navigation bar?)

    Ive tried to split the database in to back end and front end. but i cant make a accde file, i get an error saying i have too many tables and forms and such. any ideas to fix this?
    Last edited by farmi; 07-19-2018 at 09:23 AM.

  5. #65
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Sorry but don't really get it. What is a listform and where would you use it? You can use record is to navigate, I usually have a couple combo-boxes on the form's header that, when something gets entered in them, would navigate to that record using the ID. On what form you need to search? Have a look at the Geneesmiddelbewerkformulier form where I added two finders. As for error on accde I can't really help you as I don't have your split front-end.

    Cheers,
    Vlad
    Attached Files Attached Files

  6. #66
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    Click image for larger version. 

Name:	Naamloos.jpg 
Views:	33 
Size:	195.8 KB 
ID:	34780
    this is a list form? not sure if the name is correct. when the button is clicked it opens the geneesmiddelbewerkingsformulier on the specific record.

    Im just trying to find the best way for a use to easisly find a record from the overzichtstabel. Your solution is also a great one. maybe i can combine these two.

    here's my current db front and backend https://drive.google.com/open?id=1EE...u9xkqA1N1TAjvm
    user password: st
    user account: st
    admin: rr
    admin pw: 123

  7. #67
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Here it is, give it a try now. That form view is called continuous form, that is why I wasn't quite sure what you meant. I have added the two combo-boxes to it and also added code in the double click events of the Geneesmiddel and KNMPNumber textboxes. So now you can use the combos to find the record and click your button or double click either the Geneesmiddel or the KNMPNumber textboxes.

    I have created an accde for you, the error you got was misleading, you couldn't do it because the VBA project had errors and couldn't be compiled. I have commented out the MyPrintScreen sub and I was able to create the accde. Always make sure that all your code modules require explicit variable declaration (have the Option Explicit at the top) and always compile the code and remove all compile errors before deploying it.

    PS: you will need to relink the front-end to your be.

    Cheers,
    Vlad
    Attached Files Attached Files
    Last edited by Gicu; 07-20-2018 at 11:58 AM.

  8. #68
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    awesome this works great.

    is it also possible to save a printscreen of the geneesmiddelbewerkformulier each time the save(opslaan) button is clicked?

  9. #69
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Instead of saving the print screen of the form create a report and set its recordsource property to be restricted to the current record loaded in geneesmiddelbewerkformulier then use docmd.outputto acOutputReport, "rptCurrentGeneesmiddel",acFormatPDF,"C:\MyFIles.. ...",False to output the report as PDF in your desired location.

    Cheers,
    Vlad

  10. #70
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    https://drive.google.com/open?id=1EE...u9xkqA1N1TAjvm

    Code:
    Private Sub Knop179_Click()Dim FileName As String
    Dim FilePath As String
    FileName = Me.Geneesmiddel & Me.Id
    FilePath = "C:\Users\managergal\Desktop\printscreens" & FileName & ".pdf"
    DoCmd.OutputTo acOutputReport, "rptCurrentGeneesmiddel", acFormatPDF, FilePath, False
    MsgBox "Wijzigingen opgeslagen en versiegeschiedenis geupdate"
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.Close
    End Sub
    this what i did, but it doesnt save the report. the code seems to be working but the output folder stays empty.
    Code:
    SELECT Overzichtstabel.Id, Overzichtstabel.Geneesmiddel, Overzichtstabel.KNMPNummer, Overzichtstabel.Cassettenummer, Overzichtstabel.Uiterlijk, Overzichtstabel.GevaarlijkeStof, Overzichtstabel.AdviesOntstrippenStofafzuiging, Overzichtstabel.AdviesSTSOnderStofafzuiging, Overzichtstabel.CassetteBijvullen, Overzichtstabel.Zwangerschapsbeleid, Overzichtstabel.Vorm, Overzichtstabel.Breukgleuf, Overzichtstabel.PotStrip, Overzichtstabel.SoortStrip, Overzichtstabel.[HoudbaarheidNaOpenenFabrikant (mnd)], Overzichtstabel.HoudbaarheidKoertGDS, Overzichtstabel.Lichtgevoelig, Overzichtstabel.Opiumwetregistratie, Overzichtstabel.HoudbaarheidInDagenGDSKoert, Overzichtstabel.[Ingevoerd door], Barcodes.Barcode, GPKTabel.GPKNummerFROM (Barcodes INNER JOIN Overzichtstabel ON Barcodes.KNMPNummer = Overzichtstabel.KNMPNummer) INNER JOIN GPKTabel ON Overzichtstabel.KNMPNummer = GPKTabel.KNMPNummer
    WHERE (((Overzichtstabel.Id)=[Formulieren]![Geneesmiddelbewerkformulier]![Id]));
    this is the code for the record selection, that works fine

    is it possible to add dates to the filenames(also to prevent duplicate filenames)


    when in reportview, it displays the reprort 2 times under eachother, is this normal?
    Attached Thumbnails Attached Thumbnails 23432.png  
    Last edited by farmi; 07-24-2018 at 09:43 AM.

  11. #71
    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 the front-end you have now?

  12. #72
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73

  13. #73
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Try it now (you'll need to refresh the links). You forgot to add a slash before the FileName in the File Path. I added some underscores and date; I suggest you use the KNMP_ID file name instead of Geneesmiddel as the latest has slashes in it for 41 records (see new query qrySlash) which will raise an error when you'll try to save the report with that name. The duplicate for the first record was cause by duplication in the barcodes ( have added Distinct in the report record source to avoid duplicates).

    Cheers,
    Vlad
    Attached Files Attached Files

  14. #74
    farmi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    73
    howcome the qryfindduplicatebarcodes doesnt show any duplicate barcodes then? i deleted it manually now.

    thanks again, i also deleted all the slashes now.

    Is it possible for the ontstripsearch to come up as a report of somesort?

    next im trying to incorporate a blankfields check in the geneesmiddelbewerkingsformulier just like the onstripformulier, but it doesnt seem to work. even when added in the before update event.
    is Len not the correct command for this?
    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
    
    If Len(Me.Geneesmiddel & Me.KNMPNummer & Me.Uiterlijk & Me.Vorm & Me.HoudbaarheidKoertGDS & vbNullString) = 0 Then
      MsgBox "Niet alle velden zijn ingevuld!"
      Cancel = True
      Me.Geneesmiddel.SetFocus
    End If
    End Sub

  15. #75
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Try:
    Code:
    If IsNull(Me.Geneesmiddel + Me.KNMPNummer + Me.Uiterlijk + Me.Vorm + Me.HoudbaarheidKoertGDS) = true Then
      MsgBox "Niet alle velden zijn ingevuld!"
      Cancel = True
      Me.Geneesmiddel.SetFocus
    End If
    If you want to keep the slashes you could replace them with underscodes just in the filename: FileName =Replace(Me.Geneesmiddel,"/","_") & Me.Id

    Not sure what you mean regarding ontstripsearch as it is already a report.

    Cheers,
    Vlad

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