How To Hide Or Disable Print Or Quick Print Options
Dec 4, 2014
I have a form which my company wanted that each single record should be printed from form. I made a print record button and put code to print single page or record. However as a natural habit people go to file > print to print which leads printing all records so 1000's records start printing. Is there any way i can hide print button. File >Print button.
View Replies
Jun 6, 2013
I'm having an odd problem with a form. We noticed this since migrating it from adp to accdb.
It's a form with two subforms in datasheet view, that contain data on a certain employee, which is selected on the main form.
If you use print preview before printing, it all prints out fine. However, if you use quick print, it does something weird. If you Pull up Employee A, then Employee B, and do a quick print, it will print the data for Employee A in subform 1, and the data for Employee B in subform 2. It displays correctly on the screen though, and the 2nd time you quick print, it comes out right.
View 1 Replies
View Related
Feb 9, 2006
I have the below code behind a button to merge and print into MSWord and it's working wonderfully. However, how can I modify it to print 1 copy of page one, TWO copies of page 2 and one copy of page 3?
_________________________________________
Private Sub Print_Reconsideration_Click()
Dim objWord As Word.Application
'Start Microsoft Word 2000.
Set objWord = CreateObject("Word.Application")
With objWord
'Make the application visible.
.Visible = False
'Open the document.
.Documents.Open ("G:PharmacyPrior Auth Docs and DataRevised Pharmacy Denial Processes
econsideration.doc")
'Move to each bookmark and insert text from the form.
.ActiveDocument.Bookmarks("bmkFirstName").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRFirst))
.ActiveDocument.Bookmarks("bmkLastName").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRLast))
.ActiveDocument.Bookmarks("bmkHRN").Select
.Selection.Text = (CStr(Forms!frmDenial!MemberNumber))
.ActiveDocument.Bookmarks("bmkAddress1").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRAddress1))
.ActiveDocument.Bookmarks("bmkCity").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRCity))
.ActiveDocument.Bookmarks("bmkState").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRState))
.ActiveDocument.Bookmarks("bmkZip").Select
.Selection.Text = (CStr(Forms!frmDenial!ZipCode))
.ActiveDocument.Bookmarks("bmkDrug").Select
.Selection.Text = (CStr(Forms!frmDenial!DrugName2))
.ActiveDocument.Bookmarks("bmkStrength").Select
.Selection.Text = (CStr(Forms!frmDenial!Strength))
.ActiveDocument.Bookmarks("bmkDate").Select
.Selection.Text = (CStr(Forms!frmDenial!DateReceivedbyPlan))
.ActiveDocument.Bookmarks("bmkDate2").Select
.Selection.Text = (CStr(Forms!frmDenial!DateReceivedbyPlan))
.ActiveDocument.Bookmarks("bmkMDFirst").Select
.Selection.Text = (CStr(Forms!frmDenial!MDNameFirst))
.ActiveDocument.Bookmarks("bmkMDLast").Select
.Selection.Text = (CStr(Forms!frmDenial!MDLastName2))
.ActiveDocument.Bookmarks("bmkMDCred").Select
.Selection.Text = (CStr(Forms!frmDenial!Credential))
.ActiveDocument.Bookmarks("bmkFirstName2").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRFirst))
.ActiveDocument.Bookmarks("bmkLastName2").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRLast))
.ActiveDocument.Bookmarks("bmkMDFirst2").Select
.Selection.Text = (CStr(Forms!frmDenial!MDNameFirst))
.ActiveDocument.Bookmarks("bmkMDLast2").Select
.Selection.Text = (CStr(Forms!frmDenial!MDLastName2))
.ActiveDocument.Bookmarks("bmkMDCred2").Select
.Selection.Text = (CStr(Forms!frmDenial!Credential))
.ActiveDocument.Bookmarks("bmkFirstName3").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRFirst))
.ActiveDocument.Bookmarks("bmkLastName3").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRLast))
.ActiveDocument.Bookmarks("bmkAddress11").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRAddress1))
.ActiveDocument.Bookmarks("bmkCity2").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRCity))
.ActiveDocument.Bookmarks("bmkState2").Select
.Selection.Text = (CStr(Forms!frmDenial!MBRState))
.ActiveDocument.Bookmarks("bmkZip2").Select
.Selection.Text = (CStr(Forms!frmDenial!ZipCode))
.ActiveDocument.Bookmarks("bmkMDAddress1").Select
.Selection.Text = (CStr(Forms!frmDenial!MDAddress1))
.ActiveDocument.Bookmarks("bmkMDCity").Select
.Selection.Text = (CStr(Forms!frmDenial!MDCity))
.ActiveDocument.Bookmarks("bmkMDState").Select
.Selection.Text = (CStr(Forms!frmDenial!MDState))
.ActiveDocument.Bookmarks("bmkMDZip").Select
.Selection.Text = (CStr(Forms!frmDenial!MDZip))
End With
Print_Reconsideration_Err:
'If a field on the form is empty, remove the bookmark text, and
'continue.
If Err.Number = 94 Then
objWord.Selection.Text = ""
Resume Next
End If
objWord.Application.Options.PrintBackground = False
objWord.Application.ActiveDocument.PrintOut
ActiveDocument.Close wdDoNotSaveChanges
End Sub
View 2 Replies
View Related
Jul 12, 2005
OK, Im new to access, and have a database of 210,000 people.
I have to fit a lot of data printing sideways. Also in a certain format...
First thing...
There is a field that may contain RKS with other info or RKS alone. These must all be red along with the addresses, but thats it. But when I change the font color it changes the whole database. Thats it.
Other thing... I want to do a sort of exclude filter? We need to do some printing... again with the rsk, but we want to exclude anything that has rks in a specific field.
The last thing is print options/page setup...
I want to condense it as much as possible from left to right so al the needed information can be printed.
Here is how we want it printed...
__________________________________________________ ______________
Street here, house # | then other information in approated columns here
customer #, name here |
--------------------------------------------------------------------------
the problem is, street address, house number, customer number, first and last name are all in different columns.
is there anyway i can print it this way?
also the column names need to be extended downwards? some of the names are too long
like |This is column a| but we want
|this is |
|column a|
so it isnt as wide. and I can fit more columns on the page.
Thanks a lot for your help, I only have 2 hours to get this.
Martin Seidl
Oh yeah, if it helps, Im stuck with access in german :(
View 7 Replies
View Related
Dec 3, 2014
I have a database with several reports that get constantly printed, however I am having an issue with their display properties that sometimes cause errors.I need the report to come up on top of everything, maximized and with the menu bar available to allow for it to be printed or close it. The report window cannot have "minimize" or "restore" available to make sure nobody access any form behind it.
To achieve this in a form I generally use the modal property, however if I do this in a report I cannot get to the menu bar to print or close the print preview.Thinking that modal was out of the question, I went ahead and maximized the report on load and set its properties to the image attached. The db is then compiled (accde) and then distributed.
On my computer (it is being developed on my machine) the report loads fine (maximized) with no min, max or restore buttons and the print preview menu bar is shown with the print and close buttons available. See "My PC" image attached.On any other computer, the report opens up maximized but the report's restore and close buttons are enabled, however the print and close buttons on the print preview menu bar are greyed out. See "Other PC" image attached.Why the inconsistent behaviour when using the same front end?
View 5 Replies
View Related
Mar 5, 2015
I would like to disable the Navigation Pane completely, based on the security level of the user that logs in, of course.
I have code that checks their level (I'm an "Admin" and everyone else is a "User"). If they are a user, then it hides the ribbon and minimizes the nav pane. If the login is mine, it enables everything.
That works, but the only problem is that the user can just maximize the Nav Pane on their own and access all the tables, and I don't want that. I can't find any code that completely disables the pane.
I have this code connected to my login button on my login form:
Code:
If Security = "User" Then
DoCmd.ShowToolbar "Ribbon", acToolbarNo
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.Minimize
Else
DoCmd.ShowToolbar "Ribbon", acToolbarYes
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.Maximize
End If
I can go to the options menu and disable the nav pane completely, so I know since only I have access to the ribbon, I could always go in each time and recheck the display nav pane option on that menu. But, that could be a little bit of a pain having to do that each time.
Also, I know I could finish the design and convert the DB to an MDE, but since my DB isn't broken up into a front/back end, I have to access that same DB everyone else uses, and if any changes need to be made, I don't want to have to use my backup, transfer over the changes any user made to the records, and then reconvert it back to an MDE each time.
If it's possible, I'd like to do all this using VBA. If they aren't an ADMIN user, then disable everything for them, but if I login, enable everything for me.
View 14 Replies
View Related
Nov 9, 2005
The code below does not give me any error. I do get a file save dialog box and i put the file name and a message saying export is done. but in reality there is no pdf file saved under what ever directory i told the system to save...
Public Sub Print2PDF(strReportName As String, Optional strPath As String)
Dim stDocName As String, strFilter As String
Dim Distiller As ACRODISTXLib.PdfDistiller
'InputPSFile - path to existing PS file in c: emp
'OutputPDFFile - path of PDF file to be created in c: emp
'2 lines of code:
'ACRODISTXLib.PdfDistillerClass Distiller=new ACRODISTXLib.PdfDistillerClass();
'Distiller.FileToPDF(InputPSFile, OutputPDFFile,"");
Set Distiller = CreateObject("PdfDistiller.PdfDistiller.1")
Distiller.bSpoolJobs = False
Distiller.bShowWindow = False
ITransform_Transform = False
'Ask for the path if it is not provided
If Trim(strPath) = "" Then
strFilter = ahtAddFilterItem(strFilter, "Adobe PDF Files (*.pdf)", "*.pdf")
strPath = ahtCommonFileOpenSave( _
OpenFile:=False, _
Filter:=strFilter, _
flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY)
End If
'If Distiller.FileToPDF(pFromFile, pToFile, "") Then
'If Distiller.FileToPDF("strReportName.ps", "", "") Then
Distiller.FileToPDF "strReportName.ps", "", ""
'Distiller.FileToPDF OutputDir & "" & ps, OutputDir & "" & pdf, ""
' ITransform_Transform = True
'End If
Set Distiller = Nothing
End Sub
View 1 Replies
View Related
Nov 10, 2005
I used to be able to create PDFs, automatically save them to a file,
and mail them out to people. This was on Access 97 with Windows NT.
We've changed to Windows XP and Access 2003. Doesn't work anymore.
Part of the problem is that the users have no access to the registry
and can only save files on the C: drive to their My Documents folder.
I found this code on the web, but it doesn't work either. The files
continue to print out of my printer instead of making a PDF. I put the
entire code at the bottom, but here is the part I'm calling:
Public Sub SaveReportAsPDF(strReportName As String, Optional strPath As String)
Dim strOldDefault As String
Dim strFilter As String
'Ask for the path if it is not provided
If Trim(strPath) = "" Then
strFilter = ahtAddFilterItem(strFilter, "Adobe PDF Files (*.pdf)", "*.pdf")
strPath = ahtCommonFileOpenSave( _
OpenFile:=False, _
Filter:=strFilter, _
flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY)
End If
'remember old printer
strOldDefault = QueryKey("SoftwareMicrosoftWindowsCurrentVersionWindows", "Device")
'changes to pdf writer
SetKeyValue "SoftwareMicrosoftWindowsCurrentVersionWindows", "Device", "Adobe PDF", REG_SZ
SetKeyValue "SoftwareAdobeAcrobat Distiller", "PDFFilename", strPath, REG_SZ
SetKeyValue "SoftwareAdobeAcrobat Distiller", "bExecViewer", 0, REG_SZ
'Distiller.FileToPDF strReportName
DoCmd.OpenReport strReportName
'put the old printer back to default
SetKeyValue "SoftwareMicrosoftWindowsCurrentVersionWindows", "Device", strOldDefault, REG_SZ
End Sub
The entire code:
' ################################################## #######
Option Compare Database
Option Explicit
Public Const REG_SZ As Long = 1
Public Const REG_DWORD As Long = 4
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Public Const ERROR_NONE = 0
Public Const ERROR_BADDB = 1
Public Const ERROR_BADKEY = 2
Public Const ERROR_CANTOPEN = 3
Public Const ERROR_CANTREAD = 4
Public Const ERROR_CANTWRITE = 5
Public Const ERROR_OUTOFMEMORY = 6
Public Const ERROR_ARENA_TRASHED = 7
Public Const ERROR_ACCESS_DENIED = 8
Public Const ERROR_INVALID_PARAMETERS = 87
Public Const ERROR_NO_MORE_ITEMS = 259
Public Const KEY_QUERY_VALUE = &H1
Public Const KEY_SET_VALUE = &H2
Public Const KEY_ALL_ACCESS = &H3F
Public Const REG_OPTION_NON_VOLATILE = 0
Declare Function RegCloseKey Lib "advapi32.dll" _
(ByVal hKey As Long) As Long
Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias _
"RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, _
ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions _
As Long, ByVal samDesired As Long, ByVal lpSecurityAttributes _
As Long, phkResult As Long, lpdwDisposition As Long) As Long
Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias _
"RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, _
ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As _
Long) As Long
Declare Function RegQueryValueExString Lib "advapi32.dll" Alias _
"RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As _
String, ByVal lpReserved As Long, lpType As Long, ByVal lpData _
As String, lpcbData As Long) As Long
Declare Function RegQueryValueExLong Lib "advapi32.dll" Alias _
"RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As _
String, ByVal lpReserved As Long, lpType As Long, lpData As _
Long, lpcbData As Long) As Long
Declare Function RegQueryValueExNULL Lib "advapi32.dll" Alias _
"RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As _
String, ByVal lpReserved As Long, lpType As Long, ByVal lpData _
As Long, lpcbData As Long) As Long
Declare Function RegSetValueExString Lib "advapi32.dll" Alias _
"RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, _
ByVal Reserved As Long, ByVal dwType As Long, ByVal lpValue As _
String, ByVal cbData As Long) As Long
Declare Function RegSetValueExLong Lib "advapi32.dll" Alias _
"RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, _
ByVal Reserved As Long, ByVal dwType As Long, lpValue As Long, _
ByVal cbData As Long) As Long
Public Function SetValueEx(ByVal hKey As Long, sValueName As String, _
lType As Long, vValue As Variant) As Long
Dim lValue As Long
Dim sValue As String
Select Case lType
Case REG_SZ
sValue = vValue & Chr$(0)
SetValueEx = RegSetValueExString(hKey, sValueName, 0&, _
lType, sValue, Len(sValue))
Case REG_DWORD
lValue = vValue
SetValueEx = RegSetValueExLong(hKey, sValueName, 0&, _
lType, lValue, 4)
End Select
End Function
Function QueryValueEx(ByVal lhKey As Long, ByVal szValueName As _
String, vValue As Variant) As Long
Dim cch As Long
Dim lrc As Long
Dim lType As Long
Dim lValue As Long
Dim sValue As String
On Error GoTo QueryValueExError
' Determine the size and type of data to be read
lrc = RegQueryValueExNULL(lhKey, szValueName, 0&, lType, 0&, cch)
If lrc <> ERROR_NONE Then Error 5
Select Case lType
' For strings
Case REG_SZ:
sValue = String(cch, 0)
lrc = RegQueryValueExString(lhKey, szValueName, 0&, lType, _
sValue, cch)
If lrc = ERROR_NONE Then
vValue = Left$(sValue, cch - 1)
Else
vValue = Empty
End If
' For DWORDS
Case REG_DWORD:
lrc = RegQueryValueExLong(lhKey, szValueName, 0&, lType, _
lValue, cch)
If lrc = ERROR_NONE Then vValue = lValue
Case Else
'all other data types not supported
lrc = -1
End Select
QueryValueExExit:
QueryValueEx = lrc
Exit Function
QueryValueExError:
Resume QueryValueExExit
End Function
Public Function CreateNewKey(sNewKeyName As String, lPredefinedKey As Long)
Dim hNewKey As Long ' Handle to the new key
Dim lRetVal As Long ' Result of the RegCreateKeyEx function
lRetVal = RegCreateKeyEx(lPredefinedKey, sNewKeyName, 0&, vbNullString, REG_OPTION_NON_VOLATILE, _
KEY_ALL_ACCESS, 0&, hNewKey, lRetVal)
RegCloseKey (hNewKey)
End Function
Public Function SetKeyValue(sKeyName As String, sValueName As String, vValueSetting As Variant, lValueType As Long)
Dim lRetVal As Long ' Result of the SetValueEx function
Dim hKey As Long ' Handle of open key
' Open the specified key
lRetVal = RegOpenKeyEx(HKEY_CURRENT_USER, sKeyName, 0, KEY_SET_VALUE, hKey)
lRetVal = SetValueEx(hKey, sValueName, lValueType, vValueSetting)
RegCloseKey (hKey)
End Function
Public Function QueryKey(sKeyName As String, sValueName As String)
Dim lRetVal As Long ' Result of the API functions
Dim hKey As Long ' Handle of opened key
Dim vValue As Variant ' Setting of queried value
lRetVal = RegOpenKeyEx(HKEY_CURRENT_USER, sKeyName, 0, KEY_QUERY_VALUE, hKey)
lRetVal = QueryValueEx(hKey, sValueName, vValue)
QueryKey = vValue
RegCloseKey (hKey)
End Function
Public Sub SaveReportAsPDF(strReportName As String, Optional strPath As String)
Dim strOldDefault As String
Dim strFilter As String
'Ask for the path if it is not provided
If Trim(strPath) = "" Then
strFilter = ahtAddFilterItem(strFilter, "Adobe PDF Files (*.pdf)", "*.pdf")
strPath = ahtCommonFileOpenSave( _
OpenFile:=False, _
Filter:=strFilter, _
flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY)
End If
'remember old printer
strOldDefault = QueryKey("SoftwareMicrosoftWindowsCurrentVersionWindows", "Device")
'changes to pdf writer
SetKeyValue "SoftwareMicrosoftWindowsCurrentVersionWindows", "Device", "Adobe PDF", REG_SZ
SetKeyValue "SoftwareAdobeAcrobat Distiller", "PDFFilename", strPath, REG_SZ
SetKeyValue "SoftwareAdobeAcrobat Distiller", "bExecViewer", 0, REG_SZ
'Distiller.FileToPDF strReportName
DoCmd.OpenReport strReportName
'put the old printer back to default
SetKeyValue "SoftwareMicrosoftWindowsCurrentVersionWindows", "Device", strOldDefault, REG_SZ
End Sub
View 1 Replies
View Related