Search results

  1. S

    moving SQL 2000 to SQL 2008

    Hi I've just moved a hosted SQL Server 2000 backend to a new host running 2008. I have 2 questions that I hope someone can answer for me: 1) In 2000, the tables seemed to have a default sort order. In 2008, there seems to be no sort order. Is there a table setting for default sort order and if...
  2. S

    Using an IN statement in VBA

    Using a case statement never occurred to me. That will work perfectly. Thanks, Sup
  3. S

    Find pound sign ('#') in field string

    Unfortunately, Chr(35) produces the same result as #. Using Like "*#*" in a query returns all records, the same wildcard result as it does in every other method I have tried. If I test a string set in my code, it will recognize the #? This code returns a messagebox with the number 5: If...
  4. S

    Using an IN statement in VBA

    I'm trying to replace a cumbersome multiple OR statement with an IN statement, but it is erroring out (in A2K). Instead of this code: If str = "A" OR str = "B" OR str = "C" OR str = "AB" OR str = "BC" Then 'do stuff End If I'd like to use this code: IF str IN ("A", "B", "C", "AB, "AC")...
  5. S

    Find pound sign ('#') in field string

    In my table, some records include a pound sign character (#) in the FirstLine field, and some don't. I'm trying to determine which records do have a # using the following code: Dim rst as DAO.Recordset Dim str as string Dim blnPound as Boolean Set rst = Currentdb.Openrecordset("Table1")...
  6. S

    string combinations

    I have cobbled together the following code that will create a series of strings with a period after each character in sequence: Dim strInput As String Dim strChar() As String Dim intLen As Integer, intPos As Integer Dim i As Integer Dim strResult As String strInput = "abcd" intLen =...
  7. S

    word number of specific word in string

    Thanks to everyone for your help with this. I'm using this function to manipulate/standardize mailing name data from many different sources for entry into a new table. I was stumped on this one, but your help got me where I needed to go. Here's the function that I got to work: Public Function...
  8. S

    word number of specific word in string

    Hi Paul, I started out using the instr function to determine if the was an " and " in the field. Then I used the Split function to separate the 2 names. The issue is that sometimes " and " is part of the title as in: Senator and Mrs. Jack Jones in which case I don't want to split the string...
  9. S

    word number of specific word in string

    I have a mailing list in which the name field may contain 2 names such as: Mr. John Smith and Ms. Mary Jones This should be split to 2 fields on the word " and ": Name1 = Mr. John Smith Name2 = Ms. Mary Jones The name field may also contain: Mr. and Mrs. James Smith This should not be...
  10. S

    open recordset from fixed width text file

    Galaxiom, Using RST.Fields(0) does the trick. Thank you very much, Sup
  11. S

    open recordset from fixed width text file

    I need to open a recordset from a fixed width text file in order to update matching records in a table. The text file has approx 100 records. There are 3 fields: ID1 9 characters wide ID2 12 characters wide Amt 12 characters wide I can open the recordset with the following code: Dim...
  12. S

    dao.recordset select from xls file

    I would like to be able to create a dao.recordset from a .xls file, and also a .dbf file. I use the following code to create a dao.recordset from a .csv or .txt file: Dim sql as string Dim rst as DAO.Recorset sql = "Select * FROM [Text;;FMT=Delimited;HDR=YES;IMEX=2;DATABASE=C:\Documents and...
  13. S

    rst field name from string

    Perfect! Much appreciated, Sup
  14. S

    rst field name from string

    I am looping through a recordset and updating another table based on a field in the current record in the loop. The field names in this recordset change depending on the source of the update file. On my form I have a combo from which the user can select the correct field name. I need to be able...
  15. S

    createquerydef with all but last column

    Thanks Trevor. If it helps anyone, I built the Select statement using all of the fields except 'GrpNo' using the following code: Dim rstFlds As DAO.Recordset Dim fld As DAO.Field Dim strSQL As String Set rstFlds = CurrentDb.TableDefs("Table1").OpenRecordset strSQL = "Select " For...
  16. S

    createquerydef with all but last column

    I am exporting a table to a csv file using the following code: strSQL = "Select * from Table1 Where GrpNo = 2" Set qdf = CurrentDb.CreateQueryDef("qryGrp2", strSQL) qdf.Close DoCmd.TransferText acExportDelim, , qdf.name, "C:\Grp2.csv", True The columns in the table may change, but the last...
  17. S

    keep navigation pane locked after link table

    It seemed that the times that my HideNav function didn't work, it was being called from a modal form. After many searches I found this post: http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/0a34dbec-5078-4e16-b6a7-78f62c39f1bf/ which helped me put together the following function...
  18. S

    keep navigation pane locked after link table

    I have created the following function to hide the navigation pane after linking a table: Public Function HideNav(strTblName As String) DoCmd.SelectObject acTable, strTblName, True DoCmd.RunCommand acCmdWindowHide End Function I call this function each time I link a table like this...
  19. S

    keep navigation pane locked after link table

    I don't want users to have access to the navigation pane in a 2007 app. I have the option to show the navigation pane unchecked, but that doesn't hide it. So, I'm locking the navigation pane when the main form opens with this code: DoCmd.LockNavigationPane True From time to time, the app will...
  20. S

    This database has been opened read-only

    Thanks GinaWhipp
Back
Top Bottom