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!

Search results for query: *

  • Users: shVBA
  • Order by date
  1. shVBA

    3021: No Current Record - Update Query

    Hi, Thanks for your reply, I have amended the SQL and set the query running, however it has been running for over 5 minutes now and is still only 1 little blue bit of running through the query if you understand what i mean. This would suggest that the query is going to take a long time and i...
  2. shVBA

    3021: No Current Record - Update Query

    Hi, Im fairly new to creating databases and please be nice as my database is probably not the best designed but im trying. My database is designed to compare two datasets from our internal systems and then append data mimatches into [Mismatch Table - Results] then people can use forms and such...
  3. shVBA

    Automatic calculation when opening XL file

    Hello, With the Workbook Open Event you could try this.... [code] Private Sub Workbook_Open() Sheets("Sheet1").Range("A:A").Calculate End Sub [\code] Just change the sheet name and range to whatever you need...
  4. shVBA

    Microsoft Query Not Running Query

    no, as soon as it has put the SQL in is changes the statusbar to "connecting to datasource: for about 2 seconds and then ends.... The code takes less than 20 seconds to run...
  5. shVBA

    Microsoft Query Not Running Query

    Apologies... Sub Refresh_Query_5A() Dim SDate As Date Dim EDate As Date Dim MySQL As String Sheets("Control").Select SDate = Range("D19").Value EDate = Range("D20").Value SDate = CDate(SDate) EDate = CDate(EDate) SDate = Format(SDate, "mm-dd-yyyy") EDate = Format(EDate, "mm-dd-yyyy")...
  6. shVBA

    Microsoft Query Not Running Query

    I have VBA cose that inserts SQL into microsoft query and then is supposed to refresh the query. The code runs fine without any errors and inserts the SQL into ms Query. once the code has finished if i look at the query it does not return any rows of data but then if i go into msQuery and exit...
  7. shVBA

    String builder question

    you could just use one variable string a = "whatever" stringa = stringa & " Whatever else" etc just a thought....
  8. shVBA

    stop staff cracking excel workbooks

    i dont believe there is a way to stop this, excel has not been developed as a secure application, the security in excel is to avoid errors more than deny access. i am not aware of a way, but you could limit the access to certain usernames if that would help?
  9. shVBA

    Adding dates to ComboBox

    I have written two snippets of code one to convert the date to a string and another one to convert back to a date, im not sure if this is exactly what you want but: Today = FormatDateTime(Now(), vbShortDate) Tomorrow = FormatDateTime(Now() + 1, vbShortDate) Today = CStr(Today) Tomorrow =...
  10. shVBA

    How to run the macro automatically

    Also, once the code is in the open workbook module, yyou will need to tell VBA what it is refreshing ie: Sheets("Sheet1").QueryTables(1).Refresh BackgroundQuery:=False
  11. shVBA

    Using SQL in VBA to Query External Database

    The problem im having seems odd, it connects to the database and then seems to refresh really quickly. when it finishes there is no data there, but if i go into microsoft wuery and click "cancel and return data to excel" then it runs the query with the parameters set by the VBA code. Does anyone...
  12. shVBA

    Using SQL in VBA to Query External Database

    ok sorry about this i have managed to get the dates in the right format now... BUT! the actual query is not refreshing, the SQL is being entered and if i go into microsoft query it has already been changed dependant on the variables and i can then run it but when it goes through the refresh...
  13. shVBA

    Using SQL in VBA to Query External Database

    Thanks for everyone's help... There is just one last thing.... it is running fine now with no errors however it is running the query between the dates: 03-January-2008 & 04-January-2008 and what i need it to do is run from 01-March-2008 to 01-April 2008 i will post the code i have again so it...
  14. shVBA

    Excel Find & Replace Last n Characters in a Cell

    Just A suggestion but would it work if you wrote: Sub AddressFix() Columns("N:N").Select Selection.Replace What:=" Se ", Replacement:=" SE ", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _ ReplaceFormat:=False End Sub This may not...
  15. shVBA

    Using SQL in VBA to Query External Database

    Thanks very much - That has helped, i was getting an object error, howver i have now changed the code to contain my variable and am now getting the error: [Microsoft][ODBC SQL Server Driver][SQL Server]syntax error converting datetimefrom character string the code I have chaged is: MySQL =...
  16. shVBA

    Using SQL in VBA to Query External Database

    Hi, I am trying to use SQL in VBA to query an external database, i have set the query up in microsoft query and just want to pass the SQL to the query with variables in each time. I am getting an error when running the code at With Sheets("Sheet1").Querytable(1) The Code is as follows: Sub...

Part and Inventory Search

Back
Top