SendKeys Or Macro For "Right-click And Paste"

Dec 17, 2004

In short, my goal is to automate the function that Generates a Report, saves it as an Adobe PDF file using a "selected" file name. The selected file name is the name of the project (which is included as a datafield) in my primary tabel ( a linked Excel table). There maybe an easier way than the path I have chosen, if so please let me know.

The following provides a little more detail as to what I've done and what my problem is:

As noted above, my primary table is a linked table (Excel). There is datafield in that table that has the project code (and this is the name I want my PDF file to be). As a result, I created a new query in Access to query this project code. As a result, in my Generate Report macro, I open this query and then use the SendKey function to copy the datacell (i.e., project name) so I use this later to paste. My macro proceeds with opening my Primary Report and then "print" the file. Since I've selected Adobe PDF as my default printer, it will print to a file. As a result, the "Save PDF File as" menu pops up and the file name (Access name of the Report) is highlighted. However, my SendKey command to paste the project name does not work. When the "Save PDF File as" menu is up, the primary menu (ie., that has File, Edit, View, etc.) is inactive and my sendkey command will not process. However, at this point the mouse is still active and I can manually right-click the mouse and select paste for it to work.

The question is --- is there a way to perform the right-click and paste in a Macro or SendKey function. I don't see a SendKey command that invokes the right-click.

View Replies


ADVERTISEMENT

Double Click To Paste

Nov 2, 2007

I want to lookup a list of employees (in a form) and by double clicking a name listed, have that name pasted into another form or Sub form to add details to it.

I want to select a number of employees and add info such as attending a training session, plus the topics covered, instructors name etc. I want to add this info once but relate it to a number of employees who attend the training???

View 1 Replies View Related

Copy And Paste In Right Click Menu

Dec 27, 2013

I am making a custom right click menu for our company database using this tutorial:

[URL] ....

The thing I can't find when making this macro is copy or paste. I want to add these to it but I can't find it using run command or anything. How to get these 2 in the menu?

View 1 Replies View Related

General :: Use VBA To Click A Button That Fires A Macro?

Sep 4, 2012

enable me to run some code before a button is clicked I want to be able to click a button via VBA code.Basically I used the auto button wizard to make an add record button.To ensure a shed loads of if checks and queries on the entered form data run I wanted to make this button invisible, then make a new button running code not embedded macros to run my checking module then click.

View 9 Replies View Related

Sendkeys

Jul 6, 2005

I have an update query (thanks nofriends ) that I execute from VB code when closing a form. As you know, you get prompted if you really want to run the update, and then if you want to continue after it tells you how many rows are updated.

I used Sendkeys "{Enter}", True and Sendkeys "{Enter}

In both cases the action of the enter key was not automatically executed. Any ideas on what I am doing wrong?

Thanks again,

Beagles

View 3 Replies View Related

Can A Memo Field In Different Records Be Combined Without SendKeys

Jan 4, 2008

I have a problem that is Vista related. My business partner has just purchased a laptop with Vista and one of the problem areas is SendKeys. I don't have Vista and he is away at the moment so we only have part time communication so I am trying a few solutions in the hope of getting the problem fixed.

He is getting a message along the line of.....Access needs to be reinstalled because SendKeys is not available.....he does not has his MSOffice with him so that can't be tried at the moment, although everything else is working OK.

There are a few macros involved but I have converted then into VB Module and that works OK for me on XP, although it does not carry out all instructions but it basically works. But it will be a few days before he can try what I have sent him.

Note: I just notice that my conversion to VB module is not doing the SendKeys. No messages etc it is if the section covering SendKeys was not there. The example below was done with XP and macro. The SendKeys and the various other actions are all in the module. Edit...All is OK....my conversion of the macros to a module worked:D

So I would like to try another possible solution and that being to avoid SendKeys.

The situation involves a file note entry system. Each file note creates a different record and in each record there is a memo field with the file note that was made and of course time and date.

There is another table that holds one record for each person that has a file note made. Whether one file note is made or a 100 file notes there is only record.......The record is created when the first file note is made and the table will not accept duplicates on the persons ID number.

When a file note is made the system then opens the record in the other table and adds with SendKeys to the entry in the memo field on the "one record only table"

A form opened on the "one record" looks like this and as you can see the contents of the memo field from the "many records" have been combined into one. Can I do this without using SendKeys

5/01/2008 11:34:51 AM Test 1 The quick brown fox jumped over the lazy dog

5/01/2008 11:35:21 AM Now is the time for all good men to come to the aid of the party

5/01/2008 11:35:50 AM Why did John have to buy a computer with Vista?

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

5/01/2008 11:37:38 AM zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
xxxxxxxxxxxxxxxxxxxxxxxxxxxx

View 14 Replies View Related

Modules & VBA :: ASCII And Sendkeys - Put Full Stop In The Field

Jan 15, 2015

I have a Combo box which contains a set of numbers divided by "."

e.g.: 1.342567.24433

When looking for a certain code, I would like to use the number pad to enter the first few e.g. 1.34 to move to the Position. In Previous Versions of Access I had a function on the key

If KeyAscii = 44 Then
DoCmd.CancelEvent 'stop the comma keypress being updated
SendKeys ".", True 'put a full stop in the field
End If

This worked fine, but in Access 7 and up, it turns off the number lock.

Is there an alternative to sendkeys to achieve the above or a way of directly turning the number lock on again?

View 3 Replies View Related

Modules & VBA :: SendKeys After Every 5 Minutes To Stop Screen Saver To Occur

Mar 3, 2015

I am writing the following piece of code to be called again and again after 30 min. But I need to do invisible mouse move to stop screen saver occurring so i want to sendkeys after every 5 minutes. The Sub abc is in module and everything works except stopping screensaver from occurring.

Code:
Private Sub UserForm_Initialize()
'Update the Barcodes printed today
Call CommandButton1_Click
'Update batches to be scanned / batches scanned today
Call CommandButton3_Click

[Code] ....

View 14 Replies View Related

Modules & VBA :: Write A More Complex Macro That Will Start Another Macro At Preset Time

Dec 8, 2013

I am trying to write a more complex macro that will start another macro at a preset time, however I am getting stopped at the first hurdle - getting a macro to run another macro.

Here is the code i am using at the moment, all I want to do currently is click the first button, then get the second macro to execute. But no luck, getting error 2157 "cannot find the procedure"

Code:
Private Sub Command3_Click()
MsgBox "1st macro running", vbExclamation, "Note"
Application.Run "teststart1"
' Application.OnTime TimeValue("19:55:00"), "teststart1"

[code]....

View 1 Replies View Related

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

Copy And Paste

Apr 5, 2006

Hi all,
I get information sent to me on email. This information then needs to be transfered onto a database. the information is always the same.
name *****
Date of birth **/*****
consultant ******
ward BLA ******

Is it possible to copy and paste all the information in one go from the email and paste everything into its correct places on a form with one action? This would save alot of time & effort on the users part.

Many Thanks

Samzie

View 14 Replies View Related

Paste Errors

Jan 8, 2008

Hi All,

I've created an Access Database off of an old Fox Pro System. What I need to do is take the data from the tables in the old system and convert them in Access '03. I have roughly 4600 records to transfer.


When I copy the data from the old system and paste it in an Access table, only 300 or so records are pasted. Also, when I check the paste errors, there are less than 100 in there. Where are they going?

Some of the files aren't pasting because there were input errors on some. Others are linked with a department and Acct number and some of those are no longer current, so another reason why some of these records aren't pasting. This is a problem, but should only be around 500-1000 records tops.

I have noticed if I paste less at a time, I get less errors and more are actually copied through, but I don't know exactly how many I should do at a time?


Some questions I have are:

1. How many should I paste at a time?

2. Am I missing something with the paste errors, is there like a setting I can adjust?

3. Is there a better way to convert this old table into a new table?


Any suggestions or comments would be great because I have been stuck on this for a while and I DO NOT want to input these records one by one.

Thank you in advance,

Josh


Here's an email I sent to one of my friends seeing if he had any insight. I might explain my problem a little better here:

Purchasing Department has an old Fox Pro Contract System. I made this same system into Access and it works great. My problem is now converting the tables from the old system into the new system. There are approx. 4200 records. I have tried pasting them all in together and also sections at a time, but everything I do so, I get more or less copied through, and more or less paste errors displaying the ones that hadn’t copied over.

The reason some are not pasting in is because of old user input errors. Another reason is department and account numbers have changed therefore when the copy takes place, if Access doesn’t recognize an Acct number, then it cannot relate it to a department and will not paste in. I’m fine with that though. The problem I’m having is I’m always getting different amounts of errors each time I do this. For example, I did the first 500 records. Had 21 paste errors, all the others pasted fine. I then tried to do less so I copied the first 400 and only received 3 errors, but then I did the next 400 after that and only 200 pasted through and it only displayed 20 or so paste errors. I think there are roughly 400-500 bad records so I’m not understanding why all but those 400-500 paste.

View 3 Replies View Related

Cannot Paste Data

Oct 12, 2006

Hi.
I'm having trouble with two tables. I'm trying to COPY and PASTE some data from one table to the other. The tables are an exactly match apparently, I check each field and they match. Once I COPY one table data and go to the next table to PASTE APPEND , it starts pasting and all of a sudden stops and I get this message:
"THE TEXT YOU ENTERED ISN'T AN ITEM IN THE LIST. SELECT AN ITEM FROM THE LIST OR ENTER TEXT THAT MATCHES ONE OF THE ITEMS."
So, I have no idea what ITEMS it's reffering to. I click OK, and I keeps telling me same thing for at least 4 OK's clicks. After I'm asked if I am sure I want to past such number of records, by then, only a porcentage of the records are copied, not all. If I say NO I do not want to copy, it still copies anyway, but again, not all the date, just a portion.
Would you have any idea how I can get this problem solved or how did I get into this mess anyway?
I'd appreciate it.
Thanks.

View 1 Replies View Related

Help With Paste Errors

Jan 8, 2008

I've created an Access Database off of an old Fox Pro System. What I need to do is take the data from the tables in the old system and convert them in Access '03. I have roughly 4600 records to transfer.

When I copy the data from the old system and paste it in an Access table, only 300 or so records are pasted. Also, when I check the paste errors, there are less than 100 in there. Where are they going?

Some of the files aren't pasting because there were input errors on some. Others are linked with a department and Acct number and some of those are no longer current, so another reason why some of these records aren't pasting. This is a problem, but should only be around 500-1000 records tops.

I have noticed if I paste less at a time, I get less errors and more are actually copied through, but I don't know exactly how many I should do at a time?

Some questions I have are:

1. How many should I paste at a time?

2. Am I missing something with the paste errors, is there like a setting I can adjust?

3. Is there a better way to convert this old table into a new table?


Any suggestions or comments would be great because I have been stuck on this for a while and I DO NOT want to input these records one by one.....

View 1 Replies View Related

Paste Function

Mar 10, 2006

I have a subform that populates the same data for every day. What I would like to do is have an OnClick even fill in all the records at once. I have tried a method of pasting, but I am sure I am either doing it worng or there is a better way.

My code:
Private Sub Command65_Click()
Me.StoreID.SetFocus
DoCmd.RunCommand acCmdPasteSpecial, "349"
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdPasteSpecial, "352"
DoCmd.RunCommand acCmdRecordsGoToNew
End Sub

I figured set focus on the first one fill in the storeid then go to next record, fill in the next storeid, etc. This does not work right.

View 1 Replies View Related

Copy And Paste?

Aug 4, 2005

To speed up my input I copy a record and paste it.

Only trouble is that I have one field in the table that is dependant on the parent table. [The customers email address which I populate with a query/combo box. There could be many, depending who the order was for.]

Q: What function could I use after the paste funtion to ammend that field automatially setting it to 'null'

Q: I looked into WM_PASTE but I'm really struggling!

Many thanks
Jon

View 1 Replies View Related

Max # Of Rows That Will Paste Into Access

Jul 2, 2007

Anyone know the answer? I'm testing something out but I'm using another querying tool to get the data which is greater than 65k (excels limit), so I can't import the data I have to manually copy/paste.

View 3 Replies View Related

How To Paste Many Criteria In Query

Jan 29, 2007

I would like to copy and paste a large number of criteria in access. Is there a way to paste the criteria in without entering each one?

Thanks

View 11 Replies View Related

HOW DO I?: How Can I Disable The Cut/copy/paste?

Dec 8, 2005

I want to disable the user from cutting/copying/pasting the value of a text box. What is the keyAscii of SHIFT as well as CTRL so on the keypress event for that textbox I can simply set it to a null.

Or is there an easier way to do this?

View 1 Replies View Related

General :: Cut And Paste From One Table To Another

Jun 9, 2014

I have 2 tables , one table I want to use as temporary information the other to use as permanent information

For example if I have 6 records in one table , I want to be able to press a button that removes those 6 records from the temporary table and put them in the permanent table. Then later as I add more to the temporary data table again press a button and then temporary data is added to the permanent table.

Therefore the temporary table will always be empty when I press the button and the permanent table will keep adding the information I transfer across .

View 13 Replies View Related

Copy From Table & Paste Problem

Mar 26, 2006

OK, here is a weird one, at least it seems weird to me. I have a field on a table, or query result, doesn't matter which, and it looks like this:"55264"25468"4562"123etc, etc.Now I need to copy that and paste it into the notepad in Windows. When I do that the pasted data looks like this:"""55264""""25468""""4562""""123"I have looked at it on the clipboard and it also looks like the above. I really need this data to paste to the notepad just like it is stored on the table (with one double quote only). It's one of those strange sounding things, please do not ask me to explain why...I just need it like that.Why the heck does the extra quote get added to the front and one get placed on the end?Test it yourself and see.Thanks

View 3 Replies View Related

Copy And Paste Control At Runtime

Feb 24, 2008

Hi Guys,

I'm trying to make a report where i will have a variable number of charts. My approach is to have one "template" chart, and copy and paste it at runtime, and then alter each new chart's properties (data source, etc) to suit

My question, and i'm sorry if it's basic, is how do i copy and paste my first chart (called "Chart1") as another control named "Chart2"?

thx for the advice
Rich

View 1 Replies View Related

Access Changes Sort Order On Paste

Mar 7, 2008

Hi all,

I'm quite new to access, and have a pretty straightforward problem (I hope):

I have a table with 300 records in 10 columns. I want to:
1. filter the data based on column A (gives me 150 visible records)
2. Copy from an excel spreadsheet which exactly matches the access table (single column only, 150 rows)
3. Paste into a new column I created in the access table

Unfortunately, when I hit paste in access, it loses the filter and pastes the data into the complete dataset (i.e. into the wrong records).

I've no idea why access won't keep the filter I set. I also tried numbering the records and sorting them based on this new column. Again, Access lost the sort order before pasting the data.

Help!

I really need to be able to paste my excel data into the table in access!

Can anyone shed some light for me?

Thanks in advance,

Lee

View 4 Replies View Related

Copy/Paste Command On A Form

Jul 25, 2006

Copy/Paste

I have a textbox on a form that automatically shows the current date. Below that, I have 3 other textboxes for dates (each representing a step in a process). Often, the same date is imputed into each of these boxes. I would like to have an “Autofill” command button that would take the date in the first box and place it in the other three. This is so basic it’s hard. My usual searches turn up nothing. Any suggestions welcome.

View 5 Replies View Related

Disabling Copy And Paste Function

Sep 22, 2006

Hi there,

I am a database designer for a UK Insurance company and have recently needed to rebuild our complaints database. One of the problems with the previous database was that staff were copying text from an application designed by Pacific Solutions (PACSOL). When the data was pasted into our Complaints database, it was causing some serious issues that made the database crash. This had started to affect people's confidence in our ability through no fault of our own. We then found out that this was due to the character set of PACSOL not being supported by access.
What we would like to do in the new database is prevent users from copying and pasting text into the system. Perhaps by displaying an error message when they press CTRL+V or do edit - paste.

Does anyone know how this can be done?

Thanks

Gareth

View 11 Replies View Related

Running Copy Paste Outside Of Access

Mar 30, 2005

CAn i change the name of a field in a a folder from access. or better yet can i automate a file being copyed from one folder to another.

For example, lets say i have a folder named photo. i want access to find all the items that finish with a "f" and copy them into a new folder named "f_Photos"

Any Help

View 4 Replies View Related







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