MSAccess VBA: Compact and Repair Database

========= QUESTION --------- Is it possible to Compact and Repair a Microsoft Access database from VBA?   ========= ANSWER --------- The short answer is no. HOWEVER - we were lucky enough after much research to stumble across an obscure forum post discussing how to do it via simply sending keys via VBA! See Examples.   [...]

By | 2017-12-01T23:47:24+00:00 January 21st, 2015|Access, Computers, Documentation, Microsoft, VBA|0 Comments

VBA RND() Function: Pick a random number

========= QUESTION ---------How do I generate a random number between X and Y?    ========= ANSWER ---------See EXAMPLES    ========= EXAMPLES --------- Int ((999 - 100 + 1) * Rnd + 100) would return a random number between 100 and 999   ========= APPLIES TO / KEY WORDS --------- Random Numbers    ========= REF ---------http://www.techonthenet.com/excel/formulas/rnd.php   ---http://anySiteSupport.com [...]

By | 2013-06-04T19:39:01+00:00 June 4th, 2013|Access, Computers, Documentation, Microsoft, VBA|0 Comments

Access: VBA: Run several buttons at once

========= QUESTION --------- Is it possible to code the event on one button to execute several buttons at once on an Access Form?   ========= ANSWER --------- Yes - simply enter the following in the code for the 'master button'  Private Sub MasterButton_Click()    Call Button1_Click    Call Button2_ClickEnd Sub   ========= EXAMPLES ---------   ========= APPLIES [...]

By | 2017-12-01T23:47:27+00:00 May 7th, 2013|Access, Computers, Documentation, Microsoft, VBA|0 Comments

MSAccess: ORA-01013: user requested cancel of current operation (#1013)

========= QUESTION ---------I keep getting the following error when executing a Query against an ODBC connected database table: --- Microsoft Visual Basic Run-time error '3146': ODBC--call failed. [Oracle][OBDC][Ora]ORA-01013: user requested cancel of current operation(#1013) [Continue]  [End]  [Debug]  [Help]---   ========= ANSWER --------- The most common issue with these types of issues is database time out. Try [...]

By | 2017-12-01T23:47:28+00:00 February 13th, 2013|Access, Computers, Documentation, Microsoft|0 Comments

Extract every other character from a string

========= QUESTION --------- I have a long number that I need to collect the 2nd, 4th, 6th, and 8th characters from.   ========= ANSWER ---------see EXAMPLES   ========= EXAMPLES ---------Store: Mid([SurvNum_Span],2,1) & Mid([SurvNum_Span],4,1) & Mid([SurvNum_Span],6,1) & Mid([SurvNum_Span],8,1)   ========= APPLIES TO / KEY WORDS ---------Microsoft Access VBA String Manipulation   ========= REF --------- http://ycmi.med.yale.edu/nadkarni/access_course/String_Frame.htm   [...]

By | 2012-02-12T15:08:57+00:00 February 12th, 2012|Access, Computers, Documentation, Microsoft, VBA|0 Comments

Oracle: ORA-01722: invalid number. (#1722)

========= QUESTION --------- When running a query from Microsoft Access against an Oracle table, I receive the following error and the query does not execute: ODBC--call failed. [Oracle][ODBC Oracle Driver][Oracle OCI]ORA-01722: invalid number. (#1722)   ========= ANSWER --------- You are likely doing a type conversion (from text type to number type) on a database field [...]

By | 2017-12-01T23:47:29+00:00 January 31st, 2012|Access, Computers, Documentation, Microsoft, Oracle|0 Comments

VBA: Run a command at the command prompt from VBA

========= QUESTION --------- How do I run a DOS command at the Command prompt from VBA?   ========= ANSWER --------- see EXAMPLES   ========= EXAMPLES --------- Shell "cmd.exe /k dir c:windowssystem*.exe", vbNormalFocus ...consider running a .bat file for more involved commands?   ========= APPLIES TO / KEY WORDS --------- Microsoft Access VBA Command Prompt Commands [...]

By | 2011-12-16T07:54:56+00:00 December 16th, 2011|Access, Computers, Documentation, Microsoft, VBA|0 Comments

VBA: Run Saved Export

========= QUESTION --------- Can you execute or run a Saved Export in Microsoft Access from VBA?   ========= ANSWER --------- Yes - see EXAMPLES   ========= EXAMPLES --------- DoCmd.RunSavedImportExport "NameOfSavedExport"   ========= APPLIES TO / KEY WORDS --------- Saved Export Saved Import   ========= REF ---------http://bytes.com/topic/access/answers/895859-how-can-i-run-saved-export-vba   ---http://www.anysitesupport.com/vba-run-saved-export/ http://anySiteHosting.com

By | 2011-12-08T13:14:17+00:00 December 8th, 2011|Access, Computers, Documentation, Microsoft, VBA|0 Comments

Access Error: #Error when trying to calculate or manipulate a field

========= QUESTION --------- All I am doing is trying to do a calculation or manipulation on a field in my query, and it comes up with #Error rather than the results. If I do the calculation in a test field, it works just fine - what's going on?   ========= ANSWER --------- Obviously, this could [...]

By | 2017-12-01T23:47:35+00:00 November 1st, 2011|Access, Computers, Documentation, Microsoft|0 Comments