How To Print On Button Click ?

Sep 6, 2006

Hi all....

I have a list box that I can select mulitple items from - I then click a search button and it runs a query that finds what I am looking for from a table and then displays the results in a subform.
In the subform I can input weights and get a percent....anyhow.

How do I set up a button so that it will print out a report or the report from the subform information that is currently being viewed.

Also, I can already do this by clicking a button on the form and pulling up the installed report program but, you need to input data to get this report.

I kinda want this button to be a "I need it now" type of print option.

Thanks...as always my questions are probably confusing...:D

View Replies


ADVERTISEMENT

Code Triggered From Label On Click Behaves Differently From Command Button On Click

Nov 7, 2006

Often I use Labels as buttons due to the fact I can colour them the way I want, and use the on click event to trigger code.
The code below however works for a command button, but not a label button.

DoCmd.OpenForm "frmdatetime"
Do While Forms!frmdatetime!OKFlag.Caption = "False"
DoEvents
Loop

When this code is run by clicking on a command button, it works fine.
If run by clicking on a label, frmdatetime opens, but the mouse will not work on either of the 2 open forms unless you go down to the windows task bar, jump onto another window, and back onto frmdatetime.
If I remove the loop with the DoEvents in it, then the problem does not occur.

Can anyone enlighten me as to why this behaviour occurs.

Thanks

Richard

View 4 Replies View Related

Forms :: On Click Event To Print Active Record?

Jul 21, 2014

I have created a form to select multiple records for a transmittal report. I added a button to the form which I would like to open the report to view the current record. In the On Click event I added the following code:

Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[TransmittalID] = """ & Me.[TBLTransmittal.TransmittalID] & """"
DoCmd.OpenReport "RPTDwgTransmittal", acViewPreview, , strWhere
End If
End Sub

The debugger keeps highlighting the row above shown in red. I've used this same code before on other forms and it worked but not sure why it isn't working this time. The only difference with this form and previous ones is that this form contains a multiple values combo checkbox (hope that's the correct term). The query that the report is based on changed the names of the field names so that TransmittalID on the form is TBLTransmittal.TransmittalID in the query.

I've tried the code with and without the extended name but each time the "Do.Cmd..." is highlighted.

View 11 Replies View Related

Click Of A Button

Sep 20, 2006

Ok if I sound like I do not know what I am talking about, that would be correct. That is why I am asking here.

So I have this form called frm_UserMaintenance

On The form I have a button

I would like to have an OnClick event that will activate one of the dialogue boxes on the tools menu.

Heres the catch. The menu is not visible and i do not want to make it visible. This makes using sendkeys a non option.

Any ideas????

View 5 Replies View Related

Force A Button Click

Feb 9, 2005

I have a form on which I have a button that I want the user to click after a cetrain field on that form is updated.
I display a little pop-up box saying to make sure that a user clicks on that button.
Is there a way to know that this button was clicked? Is there a way to not proceed with anything else until that button is actually clicked?

Thanks.

View 4 Replies View Related

Only Allow Updates After Button Click

Sep 19, 2005

Hi,

I have a form with a number of drop-down lists on it and each of these lists is bound to a field in a table.

When I return the results of a search to this form I want to allow users to be able to cycle through the records and change them if they want. However, the changes should only be saved if the user clicks on the "update record button". This button is simply the save record button by the MS Access wizard.

At the moment if they change the value in one of the drop down lists and move onto the next record the change is saved even though the user doesn't click any button. I want to prevent this from happening.

Any ideas on how I might achieve this?

If I prevent "AllowEdits" in the form properties I can't update the form using the "update record button" either.

Many Thanks,

View 2 Replies View Related

Ping At The Click Of A Button

Nov 10, 2005

Afternoon people,

Just a query (no pun intended). Is there a way to ping an ip address which is taken from a table and at the click of a button it pings? Bringing up the cmd app to show the results.

Cheers,
Storm1976

View 1 Replies View Related

Button Single Click

Nov 22, 2005

I currently have a form with a button that once clicked displays a word document,however I have to double click on the button even though the code is on the single click event property.The only line of code is as follows
OLEFile.Action = acOLEActivate

Does any body know how I can get the single click to work ?

View 2 Replies View Related

Add Record Only On Button Click

Sep 7, 2006

I was wondering if there is any way to control a user's input in to a form such that data entry does not automatically create a new record. Is there any way to collect all inputs in the text/combo boxes and create the new record only when a button is clicked? Cheers, David.

View 1 Replies View Related

Pop-Up Print Button

May 4, 2005

First I should say that this is my first post, and I'm very new to this. Now on to my problem. We have a form with a bunch (like 25) of buttons that are links to specific reports. When you click on one of the buttons the report opens up along with a little pop up form with a print button on it. How can I get this print button to print the report that is open? Do I have to put in code for every possible report that may be open, or can I just say "print the current report" somehow?

Thanks,

Nick Jones

View 5 Replies View Related

Help!Command Button Captions On Click

Aug 9, 2005

Hi all!

I have this command button whose caption switches from update record to save record with a msgbox verifying if the person really wants to take this action. On click the user is then allowed to update the record then in theory they would be able to hit the same button whose caption now reads save record, the msg box would appear with a yes or no answer required. The code I have is putting the msg box after the user clicks the update button.

Anyhelp and/or suggestions would be most appreciated!


Private Sub cmdOpen3_Click()

stDocName = "frmSearch"

If cmdOpen3.Caption = "&Update Record" Then
If IsNull(Me.FTMSubform.SourceObject) = False Then
Me.FTMSubform.SourceObject = "frmFTMInfo"

Me.FTMSubform.Form!txtFirstName.Enabled = True
Me.FTMSubform.Form!txtFirstName.Locked = False
Me.FTMSubform.Form!txtFirstName.BackStyle = 1
Me.cmdOpen3.Enabled = True
Me.cmdOpen3.Caption = "&Save Record"
Me.cmdOpen4.Enabled = False
Me.cmdOpen4.Caption = "&Update Record"
Else
Me.FTMSubform.Form!txtFirstName.Enabled = False
Me.FTMSubform.Form!txtFirstName.Locked = True
Me.FTMSubform.Form!txtFirstName.BackStyle = 0
Me.cmdOpen3.Enabled = False
Me.cmdOpen3.Caption = "&Save Record"
Me.cmdOpen4.Enabled = True
Me.cmdOpen4.Caption = "&Update Record"
End If
End If

If cmdOpen3.Caption = "&Save Record" Then
If IsNull(Me.FTMSubform.SourceObject) = False Then
Me.FTMSubform.SourceObject = "frmFTMInfo"
If MsgBox("Save update to this individual?", vbQuestion + vbYesNo, "Save Update?") = vbYes Then
DoCmd.Save
DoCmd.Close acForm, "frmFTM"
DoCmd.OpenForm stDocName
Else
MsgBox "Return to the FTMInfo Form!", vbInformation, "Save Function Aborted!"
End If
End If
End If
End Sub


~Van

View 2 Replies View Related

Adding Records Only On Button Click?

Oct 26, 2005

Adding Records Only On Button Click?

I am building a database with a single table of records. I have created a form to allow new entries to be made to the table in a user-friendly way.

The problem I’m stuck with is how do I restrict the addition of new records on the form? I want the new record to only be added to the table upon the click of a button, but at present if I tab through, or exit the form the record is saved anyway.

Not all fields on the form are required input so I’m thinking that validation of every field is not the way to go.

I only ever want the record to be saved if a user clicks on a button and under no other circumstance.

I've been trawling through the posts back to about page 15 so any help would be appreciated.

Ksan

View 4 Replies View Related

Call A Button Click On Another Form

Feb 6, 2006

Hello everyone!I need to call the button_click procedure for a button on a form (button1), from another form, if you see what I mean!.Basically the user opens form1. They click a button which opens form2. Once they have finished on form2 they press the close button, which is the point where I need to call the button1_click procedure on form1.I imagine it's something like this:Call Forms![frmForm1]![button1]![Click] orCall Forms.[frmForm1].[button1_Click()]But no matter what syntax I try it just won't work! They're very basic forms, with only 2 buttons on and basic commands.Any help appreciated! Thanks

View 5 Replies View Related

Deactivate Mouse Second Button Click On F

Mar 16, 2006

How can i deactivate mouse second button click on form?

Can anyone help me please?:)

View 1 Replies View Related

Queries :: Add New Record By Using VBA Or SQL Once Click A Button?

Sep 27, 2013

How to add new record by using vba or sql once click a button?

View 1 Replies View Related

Modules & VBA :: Run A Function On Button Click

Sep 24, 2013

I try to run a function off of a button click.

The code is

Private Sub Command_Click()
Run fuctionname()
End Sub

The code is ran, but then I get a msg box : Run-time error '2517':

Microsoft Office Access can't find the procedure '.'

View 5 Replies View Related

Run Button Continuous Form With One Click

Aug 9, 2014

I have a continuous form with button for every record, wich has a VBA code. I want to put Button in header form, when i click it, then should run all button in continuous form. How can I do that.

View 14 Replies View Related

Export To Excel On Button Click

Jan 28, 2012

Export to excel on button click:

How can I export a query result into excel on a button click?

View 2 Replies View Related

How To Make Click A Button On Form

Feb 21, 2014

After data is entered into text box, on the "On Enter" event, how do I make it click a button on the form?Similar to the effect of when you enter your username then password, most people just hit enter on the keyboard to auto click the login button.

View 1 Replies View Related

Print Button On Form.

Apr 28, 2005

Hi... being extremely new to Access, i am sitting here frustrated as anything trying to make this work. I will attempt to explain what I am trying to do.

I have a form that has a combo box in it. This combo box references a table and pulls in the data depending on the company that is selected. What I am trying to do is add a print button on the form, so that the users can print off an address label. Now I can use the normal print report feature and this prints of the entire report, but what i would really like is the print button just to print the fields I want and not the whole thing. The fields I want to print are.

Name_1
Delievery_Address_1
Delievery_Address_2
Delievery_Address_3
Postcode

Ive had a look in the event field for the print button, but I have no idea of the commands to make it only select the fields that I want to print.

I truly am lost, and seeking guidance from the masters here at Access World.

My printing problem is in your hands.... cheers Paull

View 3 Replies View Related

Command Button Print

May 13, 2006

I have created a command button that prints a report. The thing is that if the REPORT has no data, i want that the button is INVISIBLE. Is it possible to do this??


Thanks
Andrew

View 5 Replies View Related

Print Command Button

Aug 11, 2006

I am having a minor headache with a situation, I have a command button that opens a view of the report that will be printed. The problem is if someone creates a new record and hits the button it comes up blank.

If I add me.requery before the DoCmd statement then it just restarts to the very first record and shows that in the report view =(

Any Ideas? Thanks Guys!!

Private Sub PrintForm_cmdbutton_Click()
On Error GoTo Err_PrintForm_cmdbutton_Click

Stop
DoCmd.OpenReport "Main_frm Report", acViewPreview, , "ID Like '*" & Me.ID & "'"

Exit_PrintForm_cmdbutton_Click:
Exit Sub

Err_PrintForm_cmdbutton_Click:
MsgBox Err.Description
Resume Exit_PrintForm_cmdbutton_Click

End Sub

View 3 Replies View Related

Export A Table To Excel By Click Of A Button

Aug 12, 2007

Hi,
I would like to export a table formed by a Query into a excel sheet with a Click of a Customized button. can Anyone help me how to do that.

I can do that by going to file and export to excel sheet but i need it to be done with a button of my own .

View 4 Replies View Related

Getting Current Time Into Field With Click Of Button.

Mar 13, 2006

I have been playing with the sample DB alastair69 donated in the sample db section of the site. "The nice timer function".

If you don’t start the timer right away you don’t have the correct time.

I haven’t figured out how to add a reset type of button to display the most current time in the start time field. Can any one help me out please?

View 4 Replies View Related

Display DB Document With Button Click On Form

Dec 19, 2006

I have documents (mostly Word) stored in an Access table. The table contains two fields. (1) a text field with the document's name and (2) an OLE field that holds the document.

When I press a button with the document's name on it (or it could be a hyperlink or a dropdown) on a form then I would like the document stored in the matching OLE field to open in the appropriate program for that document.

If I could set the permissions of the document to read-only then that would be great too. If I could prompt for read-only or read-write (no password necessary) access upon opening then that would be even better.

I can store documents in the table, but I have no idea how to launch them from a form button (or hyperlink, or dropdown).

Note: This is all within Access. This is not a web page related question.

Thanks in advance,
Andrew

View 3 Replies View Related

How Do I Make My Form Reset When I Click A Button On It?

Nov 11, 2004

How do i do it?

i can make a buton and edit stuff, im currantly learning VB .NET at the mo if that helps at all!!!!!

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved