Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendkeys Macro for data entry needs to read from txt 1

Status
Not open for further replies.

Tapew0rm

Technical User
Jan 25, 2002
13
0
0
US
I have a macro used for data entry that reads from a txt file and spits it all back out into a database. The problem is I need it to perform a diffrent behaviour based on a character in the txt file.

This is what im trying to do.
Do until Trim(Cstr(strTextstring2)) = "X"

I cant get it to recongnize the X though and I know im doing somthing wrong.

Any advice?

Thanks
 
We probably need to see a bit more code. How are you actuall getting strTextstring2?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Okay nevermind I just had a serious brain-fart on that one.
Now I have 2 new questions that I can't find previously posted.

1. I need this macro to perform a mouse click on a button but I have never done or seen a macro with that ability. Does anyone have some snipets of code or an idea on that?

2. I need the macro to extract information from a text box and send that to a text file. The only way that i know to get that information is to copy it (sendkeys ctrl c). Any ideas other than that I need to learn VB better?

Thanks!
 
You keep mentioning macros. What program are you using? I'm guessing from the context that you're actually working in some version of Access. If that is the case you will do better in one of the Access forums, as this is the VB6 forum not VBA.

You can find the Access programming forums in the panel at the right of this page, marked 'Related Forums'


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
No im using visual basics 6.0. I do alot of access stuff though so that must be were my termanology is off.

Here is the synopsis of what im doing.

1. fill out an excel sheet with data entry details
2 import to access export as text delemited (im lazy)
3. I have a visual basics program that reads the text file and sendkeys it into the companys system of record user interface (ProIV)

I have 2 problems with the UI.

1. there is a button that needs to be clicked and I dont know how to code that. Unfortuantly there are no keyboard strokes to get to this button.

2. With each new entry that my VB6 program makes an auto generated number appears in a text box of the companys program UI. I don't have a good way of capturing that number.

Thanks for your help.
Ryan
 
If this is a 'proper' application, you may find that SendKeys is not robust enough. It looks like you will need to get deep into API programming to find the window handle for the controls in your company app and then send messages to those windows.

To get you started have a look at the EnumWindows API, the EnumChildWindows API and the SendMessage API. more details, and some starting information and examples can be found at:

I don't see a quick and easy way of doing what you want otherwise. Good Luck!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top