Modules & VBA :: Printing Some Documents Jump Up Queue
Jan 14, 2015
I am working on a project in which we have to print word documents of each policy so if the policystatus is "Live" then we have to print a document with header(barcode) on it. If the policystatus is "Cancelled" then print off a different sheet. The following code is written that works fine but the only thing is the print order is not right. documents jump up the queue. The documents spooled last get printed off first sometimes. Any other alternator to write the following code so that sheets prints off in order:
Code:
Public LivePol As Variant
Public CancelPol As Variant
Sub GetDataFromDataBase()
LivePol = 0
CancelPol = 0
Dim myDataBase As Database
[code]....
If we can write the code in a way so that printing sheets come up in the order.
View Replies
ADVERTISEMENT
Feb 25, 2014
I was having trouble just setting each report with a particular print method - for some reason they just kept forgetting their individual settings and resorting to default on the machine.
This meant reports were printing on the wrong paper, or the wrong size paper, the wrong orientation and some times refusing to print if it couldn't find the paper (which is useful in runtime as it doesn't display error messages)
So I used Reports(rpt).printer properties (I forgot where I found this) to hard code the printer properties into each print command... this meant I had to use another function to insert the variables.
So all I had to do was say:
Code:
PrintMe("Invoice","InvoiceID",iID)
and a report would print to exactly how I wanted... but it's just too slow!
See attached for full code, I have a niggling feeling it may be the function: PrinterOK, to make sure the printer exists or not.
Code:
Function PrinterOK(sPrinterName As String) As Boolean
Dim MyPrinter As Printer
PrinterOK = False
For Each MyPrinter In Printers
If MyPrinter.DeviceName = sPrinterName Then
PrinterOK = True
Exit Function
End If
Next
End Function
I know it's the printing code, because if I stop the printing and just preview then it shows up almost instantly.
View 1 Replies
View Related
Mar 17, 2008
Dear Access Expert
I am looking for an algorithm that verifies if a queue of records is complete.
I will have a recordset with 4 to 15 records. The first field in each record will represents its position in the queue.
If there are any duplicates in the queue or gaps I want the algorithm to let me know.
for example
1
2
3
5
6
8
Would output 4 and 7 is missing.
1
2
3
3
6
Would output (3 duplicated) AND (4 and 5 missing)
Thank you so much.
View 3 Replies
View Related
May 27, 2014
I'm wondering if it is possible to create a module to hide the navigation pane and document tabs? I know this is possible via the Access Current Database options however I'd prefer this to be done via an Auto Exec that runs the sub. (i already have it for the ribbon)...
View 5 Replies
View Related
Apr 30, 2014
I want to hit a button and then it scans for a file on a server and return with a message box saying if it exists or not.
I want it so when I am on a Specific record it will search for certain requirements.
All the file names are pdf files with the same naming structure
SIT yy m(m) dd Last Name Unique Identifier
Example:
SIT 14 5 21 Smith ABCD1234567
SIT 14 10 21 Smith ABCD1234567
So I hit the button it sweeps the file path and looks for documents with this naming structure.
Last Name and Unique Identifier are fields within the db.
Last Name = txtLName
Unique Identifier = txtUniqIden
So far I have the following:
Code:
Dim strDirName As String
Dim strDirPath As String
Dim strDirName As String
Dim strDirPath As String
[Code] ....
So Far it works and I used the actual name of the items an it finds them but I need to up each record.
I have no clue how to begin with the strDirName. How to get it to scan the file name in a specific format.
View 3 Replies
View Related
Apr 10, 2014
I have a table which lists all documents that refer to a certain entity. the table contains the file names and paths. I would like the user to be able to search for text inside these documents.Can I use Windows Search for that by using code? Is there any other way?
View 6 Replies
View Related
May 27, 2014
I have the code below and I want it to open a file from my documents folder. The only problem is that every computers path is different to this folder. Any easy way to work around and open a file in My Documents without the full path?
I want to eliminate the part of the path in red and make it universal because computers will have a different number.
Operating System: Windows 7
Code below:
Public Function AddITARPicOffloadAnalysis()
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")
With xlApp
Dim wb As Object
Dim ws As Object
Dim Lastrow As Long
[Code] .....
View 9 Replies
View Related
Jul 31, 2013
I created a form with a ListBox and a Command Button. The users selects the values in the listbox and then click the button to create word documents. I've written VBA code to accomplish this. But it's not working properly. It opens multiple word documents but all for the same one.
Private Sub Command6_Click()
Dim appWord As Object
Dim varItem As Variant
Dim strPathToTemplateFile As String
Dim strPathToProspectiveFile As String
Dim strPreferredFileName As String
For Each varItem In Me.List0.ItemsSelected
[code].....
View 13 Replies
View Related
Oct 13, 2013
I receive mails through LN and loop through a certain folder, reading DeliveredDate, Body, Subject and writing those items into an Access-table.This works fine, before I go for the loop I put the doc in another folder and remove the current doc from the folder.
Call LNDoc.PutInFolder("SMSBackup", False)
Call LNDoc.RemoveFromFolder("SMSResponse")
Set LNDoc = LNView.GetNextDocument(LNDoc)
Loop
Without any error, without anything abnormal in the mails the code exits after a few loops, sometime after more or sometime after less read mails.The problem ist the RemoveFromFolder, not the PutInFolder function.
So to avoid this behavoir, I changed my code to finish the loop without
Call LNDoc.PutInFolder("SMSBackup", False)
Call LNDoc.RemoveFromFolder("SMSResponse")
and added after the loop a NotesCollection which should do ALL at once.But this part of the code does nothing at all (allthough found on the web).
With LNCollection
.PutAllInFolder "SMSBackup", False
.RemoveAllFromFolder "SMSResponse"
End With
The complete code looks like this:
Set objNotes = GetObject("", "Notes.NotesSession")
Set LNdb = objNotes.GetDatabase("myServer", "MyNSF")
If Not LNdb.IsOpen Then LNdb.OpenDatabase
If Not (LNdb Is Nothing) Then
Set LNView = LNdb.GetView("SMSResponse")
[code]....
View 1 Replies
View Related
Mar 28, 2014
I've been trying to search for all picture files in my documents and copy them to a folder on the desktop. I found this and it work great for searching however I'm having trouble getting the copy to work. [URL] ....
Code:
Dim colFiles As New Collection
RecursiveDir colFiles, "C:Photos", "*.jpg", True
Dim vFile As Variant
For Each vFile In colFiles
Debug.Print vFile
Next vFile
Code:
I replaced the debug.print vfile with my copy function. I've tried copyfile but it needs to specify the destination with the file name. I tried using the FSO filecopy method and can't get it to work (keep getting a compile error "Expected =") I feel the hard part is done and this part should be simple.
View 3 Replies
View Related
Jan 24, 2013
I'm trying to create a database that is going to be used to deliver some work to several of our users. Each time they open a specific form they'll be delivered a job.
The tables are organized somewhat like this
tblQUEUE
PK_ID_Job(AUTO_NUMBER)| JOB_NUMBER(INT)|LOCKED(BOOL)
tblWorkOrders (FK_ID_JOB (INDEXED DUPLICATES ALLOWED))
FK_ID_Job(LONG)|Name(STR)|Date(DATE)|
Now it works like this, the user gets an ID_JOB from queue
In the form they get all the all the work orders with that ID_JOB, the thing is i'm getting users with same duplicate orders cause i can't update the locked efficiently.
Regarding the users, the database is split, multi-user, with >30 simultaneously
I'm been trying to use dao.recordset, with transactions to try and reduce the duplicate orders.
View 8 Replies
View Related
Dec 28, 2006
I have a main pool of records (about 20,0000). Next to each record is a button that opens up a form. The popup form allows different fields on that record to be edited. I need to be able to have a requery code in the popup form that will requery the main form's records and automatically jump the the last record that was modified (or if that record was deleted jump to the next record). I have no idea where to start!
Thanks,
Paul
View 2 Replies
View Related
Sep 19, 2006
Hokay, so I have a very simple little database which has been written to make my job a little easier by logging the details of certain calls.
Everything on it seems to work fine, but there is one piece of strange behaviour that I just can't fathom...
I currently have 89 records stored (these were ported over from the old Excel table I used to use to log the calls). They imported just fine, and I can manipulate them as required. However, if I go to add a new record the next rwo to be added is 113 for some inexplicable reason. I can still add the record fine, and add subsequent ones as records 114,115,116, etc., but what I don't understand is why Access thinks the record number that comes after 89 is 113!
The table looks - to all intents and purposes - fine; just with its last rows going from 89 to 113 without listing 90-112 in between.
So...um...where are my missing records, and why does Access seem to think that 113 logically follows 89???
View 10 Replies
View Related
Feb 2, 2006
I've been using a combo box to jump to a specific record in a form. But, even with the comb box set at 15 lines long, with many hundreds of records in the form the vertical slider on the combo box is a little small and can be jumpy (moving 1/32" jumps 10 names, etc.). The combo box is formed from:
SELECT [cust num], [last name], [first name]
FROM [this table]
ORDER BY [last name], [first name];
I'd like to put in some boxes that will jump the combo box to a certain set of names. For instance, put in a box with a label on it that says "M". Pressing this button would jump the combo box to the first [last name] that starts with the letter M. For instance, if I have records for:
Lupold
Macaroni
Martin
Then it would jump to Macaroni. But, if Macaroni is deleted, then Martin would be the first name that begins with M and pressing the "M" box should jump the combo box to Martin.
View 2 Replies
View Related
Apr 17, 2015
How to create a field to that would be available only if a certain answer appears.
In my form I have a field named Issues created with a combo box within the table for this field is "Broken" When Broken answer is selected I want to jump to another combo box "Reason" so the user can select how it is broken.
View 2 Replies
View Related
May 20, 2015
I am creating a inventory database for work. I am trying to get the cursor to jump to the next text box for data entry using a barcode scanner. I have a limit on how many characters there can be in this field but yet even after it is all filled the cursor stays in that same field. I am fairly new to access, especially in code building. Do I use "After Update" under "Event" in the "Property Sheet"?
Capture.PNG
Capture1.PNG
Capture2.PNG
Capture3.PNG
View 4 Replies
View Related
Dec 19, 2014
I want to print mulitple reports with different content based on a query. It is like printing invoices of different customers based on a date selection at once / automated..Current I have it working so that I have to select 1 customer at the time.
View 7 Replies
View Related
Jul 8, 2013
My report has tens of pages and I need to save each page as separate file with ID as filename. PDF prints with ID but all in one file. I use this code.
Option Compare Database
Private Sub tisk()
Dim cesta As String
Dim kod As String
Dim Sql As String
Dim rs As Recordset
[Code] ....
View 5 Replies
View Related
Sep 5, 2014
My issue is when there are 4 records (store numbers) for any "row" on the load diagram, the last store's information is duplicated when the report is printed. It only appears once in the table, it only appears once in the query, but when the report prints it prints two lines. It also does not include the duplicate line in the totals at the bottom of the report. This leads me to believe that the issue is in my PrintLines function which is in the modPrintLoadDiagram but I am only a beginner when writing code and have not been able to figure it out on my own.
I am attaching a version of the original database. Please open rptLoadDiagram in Print Preview and look at row 3 on the right side. Store 5449 is showing up twice but should only be on there one time.
This is the only issue holding up my roll out of the database.
View 11 Replies
View Related
Feb 10, 2014
I've been asked to make sure only certain users in my database are able to print anything (i.e. Administrators). Is there any option/property to do this?
I have already built in User Access controls using the ctl.Tag property. The only way I can think off the top of my head is when a 'general user' uses it, to ensure that every control is displayed 'on screen only'. This of course doesn't stop them printing - just makes them print blank pages!
View 12 Replies
View Related
Dec 15, 2012
Assuming the following table:
Album ID AlbumTitle Song Rating
New
When I enter data, Album ID increases every time I jump to the next field. For example, when I enter: AlbumTitle, Song, Rating, Album ID is already at 4 and this is just the first record.
View 6 Replies
View Related
Apr 26, 2007
I am running A Form.
I have created it that I if I Double Click on one of the fields, it automatically creates a copy (which is run from a Query).
That all works fine.
My problem is that my Table has 500 Records and I want the Form to jump straight to the New Record after it creates it.
Here is my Code:
Code:Private Sub USName_DblClick(Cancel As Integer) DoCmd.OpenQuery "Copy_Drug" Me.RequeryEnd Sub
View 2 Replies
View Related
Jun 7, 2007
Please advise how to attach documents within a database. I have Office XP (2002).
View 1 Replies
View Related
Apr 13, 2007
I need to be able to scan documents into individual records in access and I was wondering if this could be done.
View 2 Replies
View Related
Sep 19, 2007
Is there anyway to scan documents and save them in an Access table? As of now we scan them and save them to a folder on the network. Then go into Access form to add them into the tables. Would like to automate this process all from Access but have know idea how to go about this. Any suggestions?
View 4 Replies
View Related
Jun 9, 2006
Hi all,
Sorry but I'm really new to Access and trying to make sense of all the useful advice on here!
I'm trying to programme a button in one of my forms to open up a word document as read-only. I've written the code to open up the Word application (before I found the button which did it for me! :( ) but I think I need to add one or two more lines so that word knows where the document is I want and opens it up - any ideas what these lines are?
Real sorry for the trouble - any help would be most appreciated! Thanks guys and girls.
View 4 Replies
View Related