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
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...
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)
);
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...
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...
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
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...
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.
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
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
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...
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?
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...
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
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...
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