Query In Forms Question (printing A Single Selected Query Record From A Form?)
Oct 19, 2004
What is the best way to impliment a query in a form so that the user can view the query records, and have the option to print or save the selected record using command buttons?
I tried subforms but I could not get the command buttons to work in the subform after it went into the form, it wanted to print the entire form instead of the selected record from the subform.
So in a nutshell I have 3-4 queries that are built, and I want to have them show up on my form in a format that the user can scroll through the results and select a single record of the results and then print or save that individual record from the form, if such a thing is possible.
How can I automate different printers for different reports on the same MS Access 2007 database, without having to select the printer each time?
There are two reports that are printed on the same database. Previously, I had automated form buttons to print the reports, without having to select the printer each time. This was about 8 years ago, but I don't remember how I did this. Also, I don't know SQL. Nothing against code, but I did not know how to program, and just MS Access 2007 access itself.
I am trying to create a form with a button attached to each record that would allow the user to click the button and it would automatically open outlook and fill in the TO:, SUBJECT: and BODY: fields. Here is the code that I currently have:
Code: Private Sub Command33_Click() Dim strEmail As String Dim strMsg As String Dim oLook As Object Dim oMail As Object Set oLook = CreateObject("Outlook.Application") Set oMail = oLook.CreateItem(0)
[code]...
There are two issues I keep running into:
1. This code opens outlook and populates all of the fields but pastes the email incorrectly. Instead of pasting just the email (email@email.com) it pastes the html tags as well (email@email.com#mailto:email@email.com#) which means that the user would have to delete everything between the #'s in order to send the email every time.
2. I currently have the email BODY pulling from a table but this obviously limits what I can do. I would like to simply encode the BODY within the VBA code. The setup I am looking for is: one paragraph a blank line a hyperlink to a website a blank line another paragraph
I'd like to put a command button on a form that would run a designated report but have the option of only printing selected records. I know I could just use the File/print option using selected records but that only prints the record fields displayed in the form. I want to run a special report that formats and prints more of the records fields. The problem is how have that report print the "currently selected" record or records.
All i want to do is to print my report (with the records ideally!) which has a subreport header at the top but all i am getting is a single blank record?!
Surely this is not too much to ask but it is holding up the whole project!!!
I have the need to display the return of my "Sum Query" to display in a text box.
I need the attached below value (40500) in the "SumofQuery" attachment, which updates every 5 minutes to display on the "StatusBoard" attachment text box.
I have been searching for a good 10 hours on how to do this and still cannot find it.
I am new to access and I recently encountered a double click issue
My form loads perfectly on double click event but it shows the first record instead of selected record.
My search is based on a PersonID but each PersonID has different WorkID that I wish to display on double click but it always shows the first WorkID instead of my selected record
I have tried changing the filters in the form properties but it still doesn't work for me.
Here's my code:
Private Sub SearchResults_DblClick(Cancel As Integer) DoCmd.OpenForm "WorkForm", , , "[PersonID]=" & Me.[Searchresults], , acNormal End Sub
[Searchresults] draws information from my Query
Query information:
PersonID... WorkID... Type......Location 1234..........1............Paint .....Address A 1234..........2............Electric...Address B 1234..........3............Floor..... Address C
So I created a form for the nursery at my church. It's set up so that they pick their child from a drop down menu (in a separate form), then a form opens up that brings up their child's information. I have a save and print button at the bottom, and I was able to set it up so that it does save the form and close it, but I can't figure out how to get it to print. I need to set it up so that the information displayed is all that is printed (not all the records like it keeps showing in print preview), and print it at a certain size (like a label). Everything I keep finding says to print from a report, but I have it set up as a form.
I've been trying to get my head round this one , but i'm just to thick to get it.
I have a continuous form that lists all items at a certain location. The user selects a record by clicking on the record selector and then clicks on a command button with this code:
The user then enters inspection details in to the "DivingInspectionCert" form which i want to store in a table (DivingCert) which will relate to the item. On completion of this form the user then clicks on a command button with this code:
DoCmd.RunCommand acCmdSaveRecord
If Me.RecordsetClone.RecordCount = 0 Then MsgBox "There are no items to Print", vbInformation, "EquiTrac" End Else DoCmd.OpenReport "DivingInspectionRpt", , , ("EquipmentID = " & Me!EquipmentID) DoCmd.Close
When i click on this button, the report doesn't print and i get a message "No current record". The inspection details are not stored in the table. I did have the forms RecordSource based on the table "DivingCert" but that didn't work and i have just tried a query but it is still not working.
Would be much appreciated if you can help me. Thank you
I have made a navigation form that prints the current record out as a PDF and also the option to send the current record by email as a PDF. Both work perfect when you open the form outside the navigation form. But when you open it inside the navigation form, it does not print any of the information.
The problem is in the Query report, In the criteria box for field [RequsetID] it has
I need to find a way to print the currently selected record (by clicking a button in the form) as a form. I know printing is almost always done in records, but they use the forms by hand before entering them into the computer database.
One tough part of this is that this printing function needs to be sustainable through revisions of the form, as we will be constantly updating it.
Is there a way to print the form with only the current record shown without creating a second form or report?
Hi, I am trying to run an append query, but instead of appending the whole table, I would like to only append a single record.
I have an append query, and it works like a charm. I can also get it to work with prompting the user for a parameter (in my case LeaseId which is a primary key). When the user is prompted and enters the LeaseId it only appends the single matching record. Works like a charm.
However, I don't want to prompt the user for the paramater. I want the user to generate the LeaseId based on the selections in two combo boxes.
So far the I do get the right LeaseId, but I have no idea how to actually pass the LeaseId to the query. I've tried the following, but I know it's completely wrong.
I've created a button on my ACCESS 2010 form that will send a PDF via email. However I only need to send the single record displayed on the form not all records.
The on click command of the button sends the PDF of the report. (I read that this is what should be sent; but still get the same results.)
I don't understand how and where to attach VBA code:
I have a continuous form based on a orders table and a details sub form.I list all the records in a continuos form in date of order.i need to change the colour of a single record based on the condition of a tick box on the original orders form
I have continuous form in Access 2010. I highlight selected record. Now I would like when user will select record, that record will display button to give ability user delete it. For not selected records button not visible and disable. How to display button only in selected record in continuous form?
I have tables Account (PK acctnum) and Orders (linked via acctnum to Account). There are multiple orders per account that need to be billed individually. When creating an invoice I need to add the Account to the Invoice table and the Orders to the InvoiceDetail table. I use 2 queries to accomplish this. The first one though adds multiple records to the invoice table (because of the one to many relationship). I need to keep that so I don't bill anyone with no orders.
INSERT INTO Invoices ( InvoiceDate, AcctNum ) SELECT DISTINCT Date() AS InvoiceDate, Account.AcctNum FROM Account INNER JOIN [Order] ON Account.AcctNum = Order.AcctNum WHERE (((Order.OrderNum)=[Forms]![Account]![Order].[Form]![OrderNum]) AND ((Account.BillingCycle)="on discharge") AND ((Order.EndDate) Is Not Null) AND ((Order.Closed)=Yes) AND ((Order.PatientName)=[Forms]![Account]![Order].[Form]![PatientName]));
Is there any way to get it to only add one record? I've tried limiting it with several parameters to no avail.
I have a form with 3 tab controls. Within each tab, there is a bound list box that lists records based on a combo box selection. All list boxes are bound to the same table and records in each tab will be in the same order.
I would like the same record be selected in each list box within the tabs, e.g. when record #2 is selected on tab1, the same record will be selected on tab2 and tab3, or if I click on tab 2 again and change the selection to record #3, record #3 will be selected on tab1 and tab2.
The situation is i have two forms, looking at the same table, but the main table shows more records, I would like to select a record in the datasheet subform and have the main form flick through to the corresponding record.
I have a query run that gives me a list of records that I view on a continuos form. What I want is to press a button and run a macro/Append Query to add a Single Summary record to another table.
For example my query spits out this data
Part # Quantity Serial Number GO2 1 123 GO2 2 456 GO2 2 789
What I'm looking to get is
Part Number Total Quantity Serial Number 1 Serial Number 2 .. GO2 5 123 456
I'm stuck on a couple of things.
1. Getting a new single row to append. 2. Getting Serial Numbers from several records to save on to a single record.
I have over 100 queries of weather data, for each month, and would like to display certain or filtered information for a selected month.
I have been playing around with a combo box to select a month from a given year, and was hoping that maybe an 'After Update' would do what I want. The problem I have is that I don't know how to do this, as the month picked and displayed in the combo box is variable , and so a sort of wildcard might do the job, if I knew how.
I have a totals query that shows results in a chart. It takes a parameter to limit results, by a combobox in a form.
Parameter in the query includes the OR "*" expression, in case someone wants to get the results unfiltered.
The Combobox in the form, has an AfteUpdate event that opens the chart (form) every time its value changes, by the [DoCmd.OpenForm "ChartForm" , acNormal] expression.
I don't know how to make it open the ChartForm when no parameter is selected in the combobox.
I need to create a query that has multiple criteria selected from a form For example. I will always have the customer name but then the user might also choose any one or more of the following, start date, end date, number etc
I have tried to create a select query and added the customer form element to the criteria but I am not sure how to do the rest because it will always have at least one more criteria but I am not sure which one and it may have up to 5 more criteria.