Sendkeys replacement

I am new to this forum and I apologize in advance if this question has already been answered. I am trying to find an alternative to the sendkeys macro command. I am using this command to invoke the tab key (sendkeys {tab}) to move focus to the next object in a form. The template I developed worked fine in Access 2003 and 2007, but when I started using Access 2010, this command turns off the numeric locks (on a periodic basis). In reading results of Google searches, it is recommended to avoid the sendkeys command since it has known issues, but I have not found a good alternative. I use this macro in several places in several forms, so I prefer to continue to use a macro or VBA code I can refer to in the form instead of using another command that would be control specific such as the GoToControl command. Thanks for the help.


Post your answer or comment

comments powered by Disqus
I got a new computer with Vista. Now the commands using Sendkeys no longer work. I have replaced most already but I'm hung up on

SendKeys "{Enter}"

I used this after overriding a not in list event and forcing Upper Case to save a value entered that was not in the list. You don't need to worry about the code I used in the event, just need to know how to save a field value without SendKeys "{Enter}"or SendKeys{Tab}".

THanks for your help

Anyone got a replacement.

My basic problem is that when Access opens a Word.doc the cursor is set to land on a bookmark and the SendKeys {Down 2} drops it two more spaces , ready for typing. I can move the bookmark down but people can easily rub them out.

SendKeys is a "no goer" in Vista

One of my forms opens to display just a memo field in full size. Currently I have SendKeys {F2} to place the cursor at the end of the text. Can {F2} be replaced?

I am running Window7, Access2010. I have a table with several columns. I need to search for "-" and replace it with nothing. For example, data in the column is 12-345, I need to replace the "-" to nothing and data becomes 12345. I have used sendkeys with replace in Access97 and now it doesn't work anymore. Can someone please help? It is time critical. Thank you.

hello

I am looking for a script to replace all accented ISO 8859-1 characters with their equivalents in a textbox in excel.

After entering text in a textbox, I would run a script replacing all accented characters and symbols as follows:

ö -replace-> ö
© -replace-> ©

Would you have an idea, how to do this?

Thank you

I'm trying to use the Find/Replace from the tool bar, but the field that I am working with contains nothing. On the FIND WHAT: line, I have tried everything that I have found in the help sections, but nothing works. I have tried NULL, IS NULL, " ", 0, IS BLANK, BLANK. Does anyone have any ideas? Thank you all for this site, and for all your help!!!!!!!
just me jo-

Hi,
I have a report (report A) driven by a query (Query A). I want to copy the report because of the formatting. So now I have report b that needs to be driven by Query B. Is there a way to change all of the fieldnames in the report using a find and replace?

Ex.
querya.field1 needs to be changed to queryb.field1


Thanks in advance for any help,

Matt

I have a report that uses dozens of individual text fields. In each text field there is a label that will say something such as [0399S]/[0399P]. What I want to change is the 99 to 00 so that the text field now uses the formula [0300S/0300P]. Is there a fast way of doing this? What I really want to do is do a "Replace all" but I can't seem to find a feature to do that. I'm using Access 2000.

when i pull up the report sometimes text values appear because of invalid values or calculations such as "#NUM!" AND "#DIV/0!".

i don't want to confuse the user who is pulling up this report. i want to replace these text to my own personal text. is this possible.

for example, if #NUM! appears i want it to have a value of 0.

if anyone can help i would be greatful. thanks to all in advance.

Hello all,
I come to you for help in a moment of UTTER frustration.
The scenario is as follows:
I have a report that is displaying what looks carriage return characters (little upright rectangles) that I believe are ASCII chr(9)/(10) or (13) characters and need to remove them and force a new line in my report.
I have tried the following to no avail: http://support.microsoft.com/default...b;en-us;210433
ie the offending characters are still in the report/query.
And I have also tried replacing them to no avail.
I would be grateful if anyone can anyone please offer any advice on resolving this problem?
I have attached an example and the unwanted square characters can be viewed by running report 1.
Should anyone require any further information, please let me know.

Thanks

Dean

Hi,

One of my fields has in the data. I need the to be there for posting to the web, but...

I also need to make an Access report using this data minus the . How do I strip it out for reporting purposes, Do I use an If statement and "if so" how do I write it...

Actually After researching the forums some more, I think I might need to replace the with some type of line break or return... Is that possible?

I found some modules that deal with stripping out characters, but I don't think they will work and I am quite the novice....

Any help is greatly appreciated.

Thanks,

Hello!

There is this report based on query. And there is one field which may contain school names (where one word represents a school status), as well as it may be empty.

school names (in Latvian) are like:

Avotu pamatskola
Sidgundas pamatskola
Turaidas pamatskola
Ozolu vidusskola
Irbes vidusskola
Indras internatskola

what i need and to be honest - don't know how to make it is to make a report where these names would be shown as:

Avotu p/sk.
Sidgundas p/sk.
Turaidas p/sk.
Ozolu v/sk.
Irbes v/sk.
Indras i/sk.

as you see - the word representing the school status is changed to it's short version. I believe since I use access 2003, it is better to use nested replace function but I don't know where to put it (on what event, in form or in report), as well as I don't know how to nest this function.

I would be very thankful if somebody could help.
Thank you in advance.

Hi all,

Been a long time since I posted anything on here so hope you don't mind helping me out.

I have an address field on a report which looks something like this

1 Example Street~Example Village~Example Town~Example County etc.

What I need to do is everytime the ~ symbol appears I need to replace it with a new line. I don't want to convert all the existing data in the tables as the data comes from a system I have no control over(just have access to the tables for reporting purposes etc.), and so am unable to make changes to the way data is held in the tables, I just need to do it to this one field on the report.

Hope somebody can help.

Thanks Steven.

p.s. I am using Access 97.

I'm trying to replace the decimal in a number with a comma. Both numbers come from the same table/query. Both are double, standard with three decimal places.

This works: =Replace([NBCC30],".",",")

This doesn't: =Replace([JANDRY2pt5%],".",","). The number remains in its original form.

I've been at this for an hour now, trying various combinations, including copying the not working one into the working one. The result is the same.

I remember seeing something about a love/hate relationship with Access. Right now, I love to hate it!


Hello,

In a report, I would like to replace the carriage returns(The square box) with a new line. I sure you need to use the replace function but I don't know the correct syntax. Does anyone know how to do this?

Database field


The below image is what the report currently looks like using the below code:
=Replace([ADDRESS],Chr(10),Chr(13) & Chr(10))



The below image is what I would like the report to look like:


Any suggestions would be appreciated.

Thanks

Hi,

I have try :

	Code:
	   If (DoCmd.OutputTo acReport)= vbCancel Then
        MsgBox "Cancel",vbOkOnly
    Else
        
   End If

And it don't work. I want to replace the interne message that Access gives when the action is cancel. Is it possible?

Thanks,

Le

Hi,

I have an unusual problem which I can't seem to solve. I have a report built up from sub reports containg product information (name, title price etc..) which I deliver in text format to the Marketing department.

The report looks fine when I view it in Access (except for the extra spacing), but when I view the outputted text file in Notepad all the £ symbols have been replaced with the œ character.

I use a macro with the Output To action and the Output Format is MS-DOS text. Any ideas?

Simon

(using Access 2000)

I have a text box in a report, with it's control source property set to =[BegDt].
Upon loading the report a message box pops up and asks the user for the value of [begDt]. This occurs 3 more times for 3 other parameters.

Now I want to change the design of the report so I decided to put these 4 parameters on a form so the user can fill in the 4 values all at once rather than responding to 4 message boxes that pop up when you run the report.

The problem is now the control source properties in all the different text boxes need to be changed to [forms]![frmABC]![txtBegDt] etc.etc. There are over 100 text boxes in this report that make reference to the 4 different parameters.
Is there a replace command I can use to change all the occurrences in the text boxes or perhaps a simpler way would be to pass the values to the report through code.

I tried placing this in the report header's format event and it doesn't seem to have any effect.


	Code:
	
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)

begytd = [Forms]![frmABC]![txtStDt]
endytd = [Forms]![frmABC]![txtEndDt]
curmo = [Forms]![frmABC]![cboMo]
curyr = [Forms]![frmABC]![cboYr]

End Sub

I should mention that the report uses a table (tblRecap) as it's record source. I tried using a query that refers back to the form for the parameter values but that means I have to use the query as the reports record source and that creates a problem because the report needs fields from the table to perform calculations.

Can someone help me with a solution please.

Thanks for your time.

i have a table where the data is entered like
01.10 x 01.20 x 00.20

i want to replace the first 0 and have the x to be 'X'

I placed a textbox in my report now what should i do ?
hope i can find some help for this.

Hi,
I was wondering if anybody can offer some help and advice on the following please?............

I have 2 reports.
They both display identical fields.

The difference between the two being the queries behind them (each report has its own 'integrated' query sitting directly behind the report as the record source if that makes sense).
One query summarises the values for each field.
The other query simply displays the stored values.

I am wondering whether I could replace my above method with a SINGLE report and then somehow tell it which query to use (using VBA or otherwise)?

Thank you.

Good day,

I am looking for ideas as to the best approach to achieve the following:

History:
1.)I am copy pasting data from an excel to an Access table
2.) tables to queries to report the usual behind the scene stuff
3.) From time to time the data might be replaced with new data
( this will be completely remove old data and paste everything new data)


On the report I have the following details:
(Item, Quantity, Size, Desciption)

I was thinking if I was to create a table (to store wanted editing changes, to avoid changing the orginal data over and over on every new paste)
Column A, Column B

if A = Description replace with B otherwise keep A

I am hoping for a little guidance, thoughts or ideas.

Cheers,

I am trying to use values from a calculated field of a subreport in another calculated field of a report, containing that subreport. The problem is that for records in the report, which do not have any value in the subreport, I get #Error in my calculated field. I am trying to replace that #Error with 0. How can I do that? I want to show on my report only numeric values.

Hi,

Does anyone know the VBA code to bring up the "search and replace" window in access 2007?

something like...

docmd.search and replace?

comments/thougth much appreciated

i need help in creating a macro that would automatically convert an excel spreadsheet into an access database..

each month, i basically receive a spreadsheet that has around 15 columns in it. the columns are the same each month: employee id, employee name, account id, account name, commission id, total commission amount (capitalized), commission period date, commission per month (starting from current month till december of 2012). Columns will always be the same. Most of the numbers would also mostly be the same with occasional changes to some of them.

example, if the current month is june, then commission per month column would start from june-dec 2012. if it's aug, then it will start from aug-dec 2012.

what i want is to create a macro that would let me automatically convert this excel spreadsheet into an access database each month.

the macro would also need to erase the previous month's data and replaces/repopulates it with data from the current month.

example: suppose I already June data in the access database, then July comes along. I would need to erase all of the data from June and repopulate/replace it with latest/most updated data from July.

In summary, i need a macro that automatically converts excel spreadsheet to access database and erases all of the data from previous month and repopulate it with the latest/most updated data from current month

Thanks for your help!


Not finding an answer? Try a Google search.