I need to save a new record from a form before it gets printed, the vba code behind the print button at the minute just opens the report and inserts the record in it. I need to put something in before that to save the record when the button is clicked.
The form in question is frmPlaceOrderFinal and I'm referring to the print button (command17). I've attached my system as well as an image for reference. The code that is currently behind the button:
Code: Private Sub Command17_Click() Dim strDocName As String Dim strWhere As String strDocName = "rptFinalInvoice" strWhere = "[InvoiceID]=" & Me!InvoiceID DoCmd.OpenReport strDocName, acPreview, , strWhere End Sub
I need to save the record before it is opened in the report.
Maybe a strange question but what is the best way to display access forms in a PowerPoint presentation or in printed material. If i do a print screen and then tidy it up the resolution is not great. Any ideas
I am using an MS Access 2010 table as a data source for a mail merge. I would like to update a field in the table with the date that the letter is printed. Is there a way to do this?
I have a cross_tab query, that users print on a monthly basis.
The user selects whether they want to include data for one or all of three products. So the query could show data for example for Salmon only.
I need to be able to show on the printed query, what products it is displaying for. At the moment the query is called "TotalxProccessor_Product". Once the query is printed there is no way to tell if it is for Mussels, Salmon, Oysters or all three products.
Is there an easy way to manipulate the title the query prints our with?
Or do I have to go through a report to have control?
Dear all, im trying to display a message to the user if a particular report has already been printed.
I have an unbound form with 2 (unbound) combo boxes one named “shift name” the other “shift date” and a button that prints a report (runs a print macro) based on what the user selects in these 2 combo boxes. I have a table (named “Table_shiftdates”) which stores all the shift names & shift dates + I have created a new Yes/no field named “printed?”.
(I’ve attached a pic, which may help explain what I currently have)
I believe I need to somehow set the yes/no field in this table too yes (or true) when a particular shift name and shift date has been printed.
Then do a check when the user clicks on the print button in this form to see if the yes/no field is set to true for the shift + date they select in the form, if it is true display a message such as: “Warning this report has already been printed”
Other than that I’m stumped and not what I need to do from here, anyone please help me out?
:confused: Hi, I have a form that loads from a menu option. The form has two subforms. All the specs are divided in groups within the forms and subforms. The forms depend on 3 queries that have all the tables correctly gathered. So, every title has a little print button next to it if the user wants to only print that group; if he or she wants to print the entire form, there is a button for that at the end of the form. I am currently having problems with the groups printing. Given that they mostly depend on a separate table and not the general one, every time I click any of the little buttons, I end up printing all the records in that table. I would like to be able to print only the info seen at the moment on the form.:(
Here is the code of one of the groups:
Private Sub Print_OperatingMechanism_Click() On Error GoTo Err_Print_OperatingMechanism_Click
I print a certificate for each person attending my class by sending the form (StudentForm) to a report . To save time I print and sign certificates for all preregistered students then during class I enter all students that enroll the day of class. What I would like to do is flag each preprinted record so when I select the print button after all students are entered into the database all certificates except the preprinted records will be printed. Any ideas on how to flag a printed record?
I am a beginner using Access 2007. The custom written program that I am using has a minor glitch. The report has a subform inside the main report. In this subform is a form header, detail, form footer. The information that is entered into the main report that transfers to the form header, detail, and form footer works and that data is saved with no problems. When I go to create a pdf file from this report all the data transfers to the printed pdf except the information in the form footer. I have looked at the property pages and compared all the properties and they are all identical.
Below is a screen shot of the report in the design view. The areas circled in red are the data that is missing from the pdf when printed. The area in green prints correctly as well as the main body of the report. We insert comments in the comment section and also type initials in the signature section but this do not show up when printed in the pdf. The database saves the information that is input but does not print it. Not everything in the company has access to the database so this is the reasoning for generating a pdf so that it is placed on the company drive for everyone to see.
I have a form that takes info from another form and then adds some from it's own data and then it proceeds to print a bunch of reports based on what tests were done etc. When I just print them (With preview) I have a function in the first report that prints (in its Close event) to close the form. No problem. I have a new slick little pdf thing that automatically names the files and puts them in the right spot etc. With this, after the first report is printed it closes thereby closing the form which needs to be open for the rest of the reports to open. Just put the close event on the last report that prints you say? I don't always know which report will be that last, it depends on the tests.
How can I check to see when all the reports have been printed and then close the form. Is there some way to have the form close itself after a certain time? Am I going to have to make the users close the form themselves? Let me know if this is confusing. Upon reading over this it does sound a bit confusing. Thank you for your help and patience.
How do I make the blank line disappear after the control is no longer visible? I tried to set the Height property to 0 in the OnPrint Event but I got an error message 2191, you can’t set height property after printing has started.
Greetings, I will try to explain briefly my problem.
My database is for our job card analysis. The problem being sometimes a job card invoiced for the previous month is only entered in the DB after reports have been generated/printed.
My thought was that if I could put a true/false check box in the record table to somehow mark it as true after printing month end reports. Hence late entries will reflect in the following months reports.
Is there a way of marking all the records as "reported" (True) after printing the report?
Maybe I am thinking along the wrong lines. Any suggestions?
I'm tracking some charges and want to report them based on month/year and an Early/Late (yes/no) flag within the query I created. When I wrote the report I grouped on mon/year then on Early/Late, then calculate averages. I then want to calculate the difference in the charges between the Early & Late rows. Here....
Now I want to subtract the 27 from the 116. I figured out I could assign the 27 to a field in the header and the 116 in the footer, that's the only way I could make them "stick". I then calculate the difference and things are great. Until I try to print it. When I print the difference is 0 because the group header & footer fields are both populated with the 27.
I have a form with a Yes/No checkbox. Sometimes a data entry person will use this, sometimes an associated report is printed and a technician in the field will be required to fill check the box by hand and return the report for data entry. what I have tried to format the check box, if the box isn't already checked, I can't get it to show up clearly on the printed report. It's set to Visible, width 6pt, solid, black, always display, yet it still is barely visible. Ive tried increasing the grid line thicknesses, making it shadowed, nothing seems to work. Is there anything I can do?
I am attempting to create a printed label with a concatenated field. I want the field to abbreviate several shapes and colors but i will just start with the shape.
=IIf([Shape]="round","RD","TH")
This is what my basic statement says. I am attempting to nest other options inside of this.
I have a rental database and I print several contacts for leases etc. what I want to do is have a unique reference number or something inserted to the report every time that it's printed. What I am trying to achieve is to keep track of which tenant corresponds to the report (Lease) printed by using reference number.
There is a seperate form which holds the tenants details and I would like to have a field on that form which would show the same reference number as the report so I can track which report was printed for who.
I have a report which shows the results of two separate queries in a simple table view.
One set of data varies in size depending on the amount of records and the other is a fixed size and never changes.
I'm wanting to make my report always show the fixed size data in the bottom right corner of the page when its printed.
I've tried putting it in the footer section of the report but don't want it to affect the size of the details section and just show next to the other query results.
Is this possible and if so how would I achieve this?
Whenever I export reports to PDF, the output appears zoomed and clipped. No extra pages are generated as they would be if I'm going over margins, it's just the report is clipped.
The report looks perfect in preview mode, and it looks perfect when going to an actual printer. However, when using OutputTo to save it as a PDF, this is when the report content is clipped.
I open the report in preview mode first so events are fired that show/hide various objects based on fields in the recordset.
I've tried reinstalling, and I've tried this on two different machines, one running Windows 7 and one running Windows Server 2008...both with the same results.
Hi guys, im working on a project whereby a Visual Basic module has been designed in MS Access to email out a RTF document attachment of reports to shift managers when they have hazard items not closed in their area. Im building an ASP front-end to the database and would like to incorporate a button to do the mailout, however i dont know how i can link it to fire the code when the button is pressed. Is it even possible?
I am trying to automate the process of sending a query result via email.
I have code that will export a query as an excel document, using DoCmd.SendObject, but it has the name of the query.
DoCmd.SendObject acSendQuery, "Dailyrpt", acFormatXLSX, email.address, , , "Daily Report", "This is today's report", -1, False (email.address would actually be the email address it is being sent to.)
I also have code that will export the query to excel and save it as a file, using DoCmd.OutputTo, where I was able to name it something meaningful to the end user, and include the date.
DoCmd.OutputTo acOutputQuery, "Dailyrpt", acFormatXLSX, "Z:FolderComplete as of " & Format(Date, "yyyymmdd") & ".xlsx" Dim Foldername As String Foldername = "Z:FolderComplete as of " & Format(Date, "yyyymmdd") & ".xlsx" Shell "C:Program Files (x86)Microsoft OfficeOffice14EXCEL.exe """ & Foldername & "", vbNormalFocus
Is there a way to either send the saved (renamed) file or to include the current date as part of the SendObject command?
So, my database appeared to be working OK yesterday however I occasionally saw an error in my "Update Event" script on one of my combo boxes. today, now when I try the combo box, I get a immediate crash.If im assuming its the same combo box, here is the code for that box:
Code:
Private Sub MCAcmb_AfterUpdate() Me.Model.RowSource = "SELECT DISTINCT [tbl].Record, [tbl].Model" & _ " FROM [tbl] WHERE Record = '" & Me.Recordcmb.Value & _ "' ORDER BY Model"
[code]...
I recently added a header...just tried it again and got the error:"The expression After Update you entered as the event property setting produced the following error:Object or class does not support the set of events."however I got it to work by entering VB, adding a space, removing it and then saving and entering the form view the form worked as normal. when i close and reload, i get the error again