a couple of things to try
dim db as dao.database, rst as dao.recordset
make sure you have a reference to DAO
and you forgot
dim db = currentdb
and possibly try
rst.field("fieldname").value = 300
it should work ask long as the string you pass is a valid table or select query name...
You could try exporting the queries as html files then reading them back into the body of an email. I think Outlook allows html formatted mail.
Peter
[η][β][π]
Try this:
the colour code is made up of the RGB values added together
R * 256^0 + G * 256^1 + B * 256^2
(if I remember correctly) so you should be able to reverse it using Mod and integer division
[η][β][π]
You have managed to get two WHERE clauses into your SQL string.
The first one is set in your IF statements and if the criteria is not blank becomes the WHERE statement on your SQL String.
Try removing your new text and putting another if statement to build up your where criteria.
something...
You can use QueryDefs to re-write the SQL behind the query before allowing the mailmerge to connect to the data. If it is something as simple as "SELECT * FROM [tblYourTable] WHERE [IDNum] = 3;" then it is fairly simple, somthing like:
currentDB.QueryDefs("qryYourQuery").SQL = strSQL
HTH
Peter...
try this:
Dim snp As SnapshotViewer
Set snp = New SnapshotViewerControl.SnapshotViewer
if that doesn't work make sure you have the file snapview.ocx on your system
HTH
Peter
Have a play with the addins property in excel, possibly as part of the open procedure. I use something similar:
AddIns.Add Filename:="PathToAddin\AddinName.xla"
AddIns("AddinName").Installed = True
HTH
Peter
Sanan
CancelEvent is only of use in the event part of a form or report. For example if you have an on_unload sub then it can check if criteria are met and if not cancel the close event. Your code runs off the on_click event and if criteria are met goes to a new record, if not displays a msgbox...
In the code you have posted there is no need to cancel event. I am assuming that this is your add new record button script. To refresh your subform you might need to use me.[subform].refresh or me.[subform].requery depending on what you are trying to do, try both and use help to make it work...
Ok, here is some code I wrote to check if details had been changed and if so log them. It uses the BeforeUpdate event which runs before a form is closed or before the record is changed ie next, previous, newrec,
Private Sub Form_BeforeUpdate(Cancel As Integer)
DoCmd.SetWarnings False
If...
What sort of Link? Is it a linked table? if so check that you have a DNS to the notes database, should be in the Control Panel under ODBC. If the servers have changed or you have moved PCs then you will need to edit/recreate it.
HTH
Peter
This is DAO code for creating a Query
Dim objQueryDef As QueryDef
Set objQueryDef = New QueryDef
objQueryDef.Name = "TempQuery"
CurrentDb.QueryDefs.Append objQueryDef
CurrentDb.QueryDefs("TempQuery").SQL = strSQLquery
and to remove try
CurrentDb.QueryDefs.Delete "TempQuery"
HTH
Peter
I got that message today when trying to do an export of a table. It only happened when I tried to export to the same folder my Database was in. Is this the case for your code as well?
HTH
Peter
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.