Search results

  1. D

    Open a word Doc and GoTo a specified Bookmark

    Here is some simple code that uses automation to open a word doc and goto a bookmark: Private Sub openDoc_Click() Dim objWord As Word.Application Dim strDocPath As String strDocPath = "C:\My Documents\Test.doc" Set objWord = New Word.Application...
  2. D

    SetFocus Statement

    You want something like this: Private Sub HeaderAcc_KeyDown(KeyCode As Integer, Shift As Integer) ' Get return key If KeyCode = 13 Then Address1.SetFocus End If End Sub Although you should be able to change the tab order to do this, unless your doing something out of the...
  3. D

    refresh subform

    If your subform is called mySubForm then mySubForm.requery should refresh the data in your subform. Dave
  4. D

    Filter/loop/email

    You need to open the report and change the recordsource, DoCmd.OpenReport "GCodeInvEMAIL", acViewDesign Reports!GCodeInvEMAIL.RecordSource = strQry DoCmd.Close acReport, "GCodeInvEMAIL", acSaveYes after you set strQry and before your send the report. and change this: strQry = "SELECT * FROM...
  5. D

    SendObject

    That would explain my problem, http://www.access-programmers.co.uk/forums/showthread.php?s=&postid=122331 And I switched to automation and it works fine.:) Thanks Paul P.S. Where were you when I needed you???? :) Dave
  6. D

    Filter/loop/email

    Try something like this, Public Sub sndEmail() On Error GoTo errHandler Dim strQry As String Dim rst As DAO.Recordset Dim dbs As Database DoCmd.Echo False Set dbs = CurrentDb Set rst = dbs.OpenRecordset("SELECT * FROM Employees") If Not rst.EOF And...
  7. D

    SendObject

    Rob, I have almost identical code in a continuous form and it works fine. Seems odd that it doesn't do anything at all. Have you tried stepping through the code to see what is happening? Dave
  8. D

    copying a value from list box with a record source to one without

    Private Sub cmdCopySelected_Click() Dim frm As Form, ctl As Control Dim varItm As Variant, intI As Integer Set frm = Forms!frmMyForm Set ctl = frm!lstMyList Set ctl2 = frm!lstMyList2 For Each varItm In ctl.ItemsSelected For intI = 0 To ctl.ColumnCount - 1...
  9. D

    Sendobject is freaking me out!!!

    Thanks Mate, I changed my code to use automation, and it works fine now using the exact same string that caused the initial problem.:confused: Thanks for the tip about the declaration. I generally use seperate lines, I just changed it for the forum. But I was under the (mistaken) impression...
  10. D

    Sendobject is freaking me out!!!

    This is very weird! Here is my code: Dim strEmailAdd, strBody, strSubject As String strBody = "The following is your username" strEmailAdd = "test@somewhere.com.au" strSubject = "Database" DoCmd.SendObject , , , strEmailAdd, , , strSubject, strBody, False With strBody...
  11. D

    Database across Multiple Sites

    Seem to have access to only a few folders on the other servers, such as temp. So I guess that would work. Wouldn't that cause problems if the same record is changed on multiple sites? Although this database will not have that many users and most will only be viewing data anyway, so it's...
  12. D

    Database across Multiple Sites

    Hi All, The company I work for has three sites, two close together and the other one half way across the country, each with their own server. Is it possible to have a database that can be used across all three sites? They need to access the same data, so I can't have seperate DB's. Any help...
  13. D

    Combo box default value

    If you put cboMyComboBox = cboMyComboBox.Column(0,0) into the forms open event it will select the first item in your combobox. The default value works ok for value lists but not sure if it works for queries??? Dave
  14. D

    Subform problems

    You will have to change these values to suit your own data. strCondition = "[memberID] = " & Me.mySubForm!memberID DoCmd.OpenForm "myform", , , strCondition memberID will be the field in your members table (primary key) mySubForm is the name of your subform control (not the name of the...
  15. D

    line breaks using doCmd.SendObject

    strMsg = "Dear So and So," & vbNewLine & "Attached is this month's XXX Report." & vbNewLine & "Kevin" DoCmd.SendObject acSendQuery, "qry_Jnut_Report", acFormatXLS, "XXX@ajn.org", , , "JNUT Report", strMsg, True
  16. D

    SetFocus to TextBox Control on Tabbed Form

    Hi Blake, try this: Private Sub myTab_Change() If myTab= 0 Then Me.myControl1.SetFocus Else Me.myControl2.SetFocus End If End Sub Dave
  17. D

    Subform problems

    David, do you mean something like this? strCondition = "[memberID] = " & Me.mySubForm!memberID DoCmd.OpenForm "myform", , , strCondition Dave
  18. D

    multiple table form?

    On each tab page, place a subform bound to the appropriate table. Dave
  19. D

    Filters and List Box Display

    It sounds as if you are applying the filter to the form and not the listbox. Otherwise the requery should work. lstMyList.rowsource = "SELECT * FROM [myTable] WHERE [myID] = 1" lstMyList.requery Dave
  20. D

    restart pc

    This is from vbapi.com ----------------------------------------------------------------------------- Declare Function ExitWindowsEx Lib "user32.dll" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long Platforms: Win 95/98, Win NT ExitWindowsEx shuts down or reboots the user's...
Back
Top Bottom