Search results

  1. T

    Changing Data type

    Check this article at Change Field Type.
  2. T

    opening help file

    There is a good module named modToolbarUtilities, came with Solutions.mdb. It shows you to use API to call the Help file. Check your MS Office CD for it.
  3. T

    load loads of pics automatically

    You mean you want to show the corresponding pict to each record in form or in report, right? In your form, just add the Image control and name it Pict (or whatever you like) then put the code below. Private Sub Form_Current() Form_Load End Sub Private Sub Form_Load() On Error Resume Next...
  4. T

    Turning off Name AutoCorrect from code?

    Sub TurnOffNameAutoCorrect() Application.SetOption "Track Name AutoCorrect Info", False End Sub Cheers!
  5. T

    SQL Statement Selecting Records and Creating Query Def

    I think you need space in you SQL string, before From and Where. StrSQL = "SELECT data.NameofRegistrant, Data.[Hospital\FacilityName], Data.Address, Data.Address1, Data.City, Data.State, Data.ZipCode" _ & " FROM Data" _ & " WHERE Data.Westin = Yes;"
  6. T

    copying files based on recordset

    Since ADO does not have RecordsetClone, so have to change Dim rs As ADODB.Recordset to Dim rs As Object
  7. T

    Mailmerge with VBA

    Do you want to filter some records to be sent to Word? Or all records. If you want to use parametered query, you have to supply the Parameters to the code as showed below. Try this out. Dim objWord As Object Dim dbs As Database, rst As Recordset, I As Integer, qdf As QueryDef Dim strSubName As...
  8. T

    Mailmerge with VBA

    Check the Knowledge Based Article, ACC: Sending the Current Record to Word 97 with Automation out.
  9. T

    Hyperlinks

    Press F2 when you are in the text box and type this line in. Electronic Version#c:\My Documents\.......\text.doc# If you'd like to change all records this way, you have to use Update Query or Recordset to help you out, like this. UPDATE YourTableNameHere SET...
  10. T

    Sorting of records

    You can force the form to sort the way you like with code. Just put the code below on OnLoad event. Private Sub Form_Open(Cancel As Integer) Me.OrderBy = "[Date], [Time]" Me.OrderByOn = True End Sub And do not name the fields with reserved words like Date, Time, Name, ect.
  11. T

    Copying to Access from Access

    You can use TransferDatabase method to transfer objects from one db to another db. DoCmd.TransferDatabase acExport, "Microsoft Access", "YourTargetDBNameAndPath", acTable, "Table1" Check the TransferDatabase method in Help for more details.
  12. T

    replicate string

    It depends on how you want to paste the string to the target field. Do you want to copy from one field to another field in the same table or diff table? How are they related? With a unique key in both fields? One record or several records? You can use Update query or Recordset to copy and paste...
  13. T

    Losing focus on a text box

    I guess you use Value property. Just leave the property out and you'll be able to use On Lost Focus event. If Me.YourTextBoxName1 <> ... Or Me.YourTextBoxName2 <> ... Then ... End If
  14. T

    Loading notepad file in a form using a on click event

    Try the code below. Just add a text box (Text0) and a command button (cmdGetText). Private Sub cmdGetText_Click() Dim objFile As Object, objText As Object Set objFile = CreateObject("Scripting.FileSystemObject") Set objText = objFile.OpenTextFile("C:\test.txt") Me.Text0 = objText.ReadAll End Sub
  15. T

    SQL or VBA to set Primary Keys

    Try the VBA below. Sub AddPrimaryX() Dim dbs As Database Dim tdf As TableDef Dim idx As Index Set dbs = CurrentDb Set tdf = dbs.TableDefs("YourTableHere") With tdf Set idx = .CreateIndex("YourTargetFieldNameHere") idx.Fields.Append...
  16. T

    Control and format Excel from Access

    I cut the portions from my old code. Check them out. Modify the portion below to meet yours. J = rst.RecordCount + 4 Sheet.Cells(J, 2).Value = "Total Sum" Sheet.Cells(J, 2).Font.Bold = True For I = 3 To rst.Fields.Count - 4 Sheet.Cells(J, I).Formula =...
  17. T

    EOMONTH function not working

    I don't think the function is available in both Excel and Access. What the function returns? The last date of a given month, 28, 29, 30 or 31? If so, try the function below. Function EndOfMonth(dte As Date) As Date Dim MyDate As Date MyDate = DateSerial(Year(dte), Month(dte) + 1, 1)...
  18. T

    Desperate

    It seems to be a known bug. Check the link Mail Merge to Word Opens Another Instance of Access out.
  19. T

    Can I set table.visible = false

    Thanks for the function. Works great! But not for A97 since the SetHiddenAttribute is not available.
  20. T

    Can I set table.visible = false

    Check the link Hide Tables out.
Back
Top Bottom