Locke504 Posted May 19, 2009 Share Posted May 19, 2009 Hello. I'm having trouble pasting information into an Access form. Right now my Autoit script grabs the text from another Program and pastes it into Notepad. It was a start, but what I really need it to do is paste the information into individual fields on a form. This is my code so far. ; Get text from Notepad and Put it into Access or Notepad ;Create Variable Dim $var1 = "No Text Grabbed" Dim $grabPrimaryIndex, $grabSecondaryIndex, $grabDrawer, $grabFolderType, $grabDoctype Dim $captureWin = "ImageRight Enterprise Scanner" Dim $pasteWin = "Untitled - Notepad" Dim $pasteAccess = "Microsoft Access - Acces_Project_Main : Database (Access 2000 file format)" ; Wait for page to appear if WinWait($captureWin,"",5) Then if WinActive($captureWin,"") = 0 then WinActivate($captureWin,"") ;Make sure the controls have all been updated... requires you to change the controls's focus ControlFocus($captureWin,"","TEdit2") Send ("{TAB}") Sleep (500) $grabPrimaryIndex = ControlGetText($captureWin,"","TEdit2") $grabSecondaryIndex = ControlGetText($captureWin,"","TEdit1") $grabDrawer = ControlCommand($captureWin,"","TComboBox3","GetCurrentSelection") $grabFolderType = ControlCommand($captureWin,"","TComboBox2","GetCurrentSelection") $grabDoctype = ControlCommand($captureWin,"","TComboBox1","GetCurrentSelection") ;Open Notepad.exe if WinWait($pasteWin,"",1) = 0 Then run ("notepad.exe") ;Wait for Notepad to open WinWait ($pasteWin, "") if WinActive($pasteWin,"") = 0 then WinActivate($pasteWin,"") if ControlCommand($captureWin,"","TButton3","IsEnabled") Then $var1 = "Primary Index: " & @TAB & $grabPrimaryIndex & @CRLF $var1 = $var1 & "Secondary Index: " & @TAB & $grabSecondaryIndex & @CRLF $var1 = $var1 & "Drawer: " & @TAB & $grabDrawer & @CRLF $var1 = $var1 & "Folder Type: " & @TAB & $grabFolderType & @CRLF $var1 = $var1 & "Doc Type: " & @TAB & $grabDoctype & @CRLF Else $var1 = "BAD DATA!" EndIf ControlSetText ($pasteWin,"","Edit1",$var1) ;Only enable in final production, clicks the scan button if possible. if ControlCommand($captureWin,"","TButton3","IsEnabled") Then ControlClick ($captureWin,"","TButton3") EndIf Any Help would be extremely appreciated. Link to comment Share on other sites More sharing options...
Zedna Posted May 19, 2009 Share Posted May 19, 2009 Search forum for "ADODB.Connection"or look at some ADO UDFs outtherehttp://www.autoitscript.com/forum/index.ph...st&p=392843...It will be much simpler/safer way to put data into your target database. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Locke504 Posted May 19, 2009 Author Share Posted May 19, 2009 I'm still having trouble finding the answer to my specific question. =( Link to comment Share on other sites More sharing options...
Locke504 Posted May 20, 2009 Author Share Posted May 20, 2009 I'm still having trouble finding the answer to my specific question. =(http://dundats.mvps.org/autoit/udf_code.aspx?udf=accessI checked the UDF at the above link but didn't really spot the answer I was looking for. I feel like the answer should be really simple, I just don't think I'm asking the question right. Keep in mind I am still extremely new to scripting. =( Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now