Search results

  1. E

    Clearing Table in another database

    Try this: Dim db As Database Set db = DBEngine.OpenDatabase("c:\targetDB.mdb") db.Execute "delete * from TableToClear" db.Close Set db = Nothing HTH, Chris
  2. E

    Export to Excel

    This code will delete the file if it exists, then export the query, which is functionally almost the same as overwriting the sheet each time: Const sFile = "C:\Documents and Settings\pdainty\Desktop\RawQualityData_Weekly.xls" If Dir(sFile) <> "" Then Kill sFile End If...
  3. E

    Deleting upmatched records

    Try: DELETE tbl_Job_Access.* FROM tbl_Job_Access LEFT JOIN CMSqry_JCPDSC ON tbl_Job_Access.Job_No = CMSqry_JCPDSC.JOB_NO WHERE ( ((CMSqry_JCPDSC.JOB_NO) Is Null) );
  4. E

    Creating A/C Numbers

    Could you post the DB, as the code you have posted has introduced many extra questions that I'm not prepared to second-guess without enought information? you can strip out the data, I just really need the form and the table structure. Hazarding 1 wild guess, I'm assuming that txtPartA is just...
  5. E

    Strange behaviour with replace()

    hi, I can see that the function is add bullet points only if they have not been added already, but it's logic is flawed and in fact only checks after the first line end, so that if you remove just that bullet point, it will end up added them again from line 2 onwards. I have trimmed that...
  6. E

    Creating A/C Numbers

    hi, say GetCode is the function used to get the first 2 letters, you could do the following to get the whole code: CompCode = GetCode & Format(DCOUNT("*","[TblDatabase]","Left([CompCode],2) = '" & GetCode & "'") + 1, "000") HTH, Chris
  7. E

    Need help with a "CONTAINS" query.. sending me mad

    replace " AND (txtWhySuccFail CONTAINS (" & Chr$(34) & likeFilterCriteria & Chr$(34) & ") > 0);" with " AND (txtWhySuccFail LIKE " & Chr$(34) & "*" & likeFilterCriteria & "*" & Chr$(34) & ");" I did not really understand what you meant about the first 2 parameters. Did you add the %? Do you...
  8. E

    is it possible to change the values of checked/unchecked boxes in yes/no fields?

    Where it goes depends on how you have designed your form. Could you post the DB, or at least a stripped out version if you are worried about confidentiality, that would save me second- guessing you.
  9. E

    Trying to Delete Rows within a Loop

    dan, Chergh is right about missing data, you could try stepping the loop down, i.e. For i = 4999 to FirstRow step -1 Chris
  10. E

    is it possible to change the values of checked/unchecked boxes in yes/no fields?

    Try something like this: If IsNumeric(txtOwing) Then If txtOwing.Value > 0 Then chkFeesPaid.Value = False Else chkFeesPaid.Value = True End If End If HTH, Chris
  11. E

    Trying to Delete Rows within a Loop

    Are you trying to do this in Excel, rather than Access? If so change the delete line to: Rows(i).delete HTH, Chris
  12. E

    Append Current Record on a Form using Form Button

    Kevin, when you say it is not working, are you getting an error message, or does it appear that nothing is happening? Also, is Prem_iD in tblLicensedPremHistory an autonumber datatype? Chris
  13. E

    Shell COMMAND.COM + multiple commands

    Alberto, you can move files from one directory to another, like this: dim fso as object set fso = CreateObject("Scripting.FileSystemObject") fso.MoveFile "C:\olddir\*.jpg", "c:\newdir" the above would move all jpeg files to the newdir. If you are talking about renaming and moving a single...
  14. E

    VBA code to account for greater/less than>,< signs for my Report.

    Are you saying the most of the time me.ACOM is an integer but sometimes it is something like "<1" or ">5"? If so, what do you Access to do with it in that case.? Ignore them? Strip the sign out?
  15. E

    Insert File Path

    Or you could of course, not reference the library but use these 2 lines instead: Dim fdlg As Object Set fdlg = Application.FileDialog(3)
  16. E

    Insert File Path

    No. you need the Microsoft Office 11.0 Objects Library.
  17. E

    Insert File Path

    hi dylan, there are easier way to do it. if you have Access 2000 or later, then following code should work if you put it in the Click event of the text box,e.g for a textbox called txtFileName: Private Sub txtFileName_Click() Dim fdlg As FileDialog Dim sFile As String Set fdlg...
  18. E

    Edit "TableDef.Connect" vs Delete/Append new TableDef

    Yeah, Gemma's right. You can set the connected tablename using the SourceTablename property of the tabledef. What is important, is to call the RefreshLink method of the tabledef if you change any part of the its link information. Chris
  19. E

    Edit "TableDef.Connect" vs Delete/Append new TableDef

    hi, you may find this bit of code useful. If you have a database split into a front-end and back-end (good practice), and the back-end is not in a fixed location, but just needs to be relative to the front-end, then this code ensures that, if you ever move the FE and BE that the link to the...
  20. E

    Importing a delimited text file using VBA

    Thanks for your help, I think I'll have to stick with multiple import specifications, as, if I used a staging table, I would lose the data types of the fields which for my purposes is important. The staging table idea is interesting, though, and could work in different circumstances. Chris
Back
Top Bottom