A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Integrating the code for a max.date function with a check box controlling it and



 
 
Thread Tools Display Modes
  #31  
Old October 17th, 2005, 03:02 AM
Chris W via AccessMonster.com
external usenet poster
 
Posts: n/a
Default Integrating the code for a max.date function with a check box controlling it and

Hi Guys
Sorry about the late reply, don’t have access to the net from home.

But the good news is that this morning I have managed to get it working in
all the ways I hoped that it would. I can’t thank you both enough; or
everyone from access monster over the last few months. Seriously I would buy
you guys a beer if I lived in the same state or for that matter the same
country.

Thanks again.

P.S. I am sure that I will be back asking for help when it crashes as soon as
someone tries to do something I didn’t expect.


Ken Snell [MVP] wrote:
A function that would delete records from a specific table would be this
(pass the name of the table to the function):

Public Function DeleteRecordsFromTable(strTableName As String) As Boolean
Dim dbs As DAO.Database
On Error GoTo Err_Handle
Set dbs = CurrentDb
dbs.Execute "DELETE * FROM [" & strTableName & "];", dbFailOnError
DeleteRecordsFromTable = True
Exit_TheFunction:
dbs.Close
Set dbs = Nothing
Exit Function
Err_Handle:
DeleteRecordsFromTable = False
Resume Exit_TheFunction
End Function

A function that would run your 'append query' would be this (pass the name
of the query to the function) -- note that this same function will work if
you pass the name of a 'make table' query to the function:

Public Function AppendRecordsToTable(strQueryName As String) As Boolean
Dim dbs As DAO.Database
On Error GoTo Err_Handle
Set dbs = CurrentDb
dbs.Execute strQueryName, dbFailOnError
AppendRecordsToTable = True
Exit_TheFunction:
dbs.Close
Set dbs = Nothing
Exit Function
Err_Handle:
AppendRecordsToTable = False
Resume Exit_TheFunction
End Function

Hi Ken, Thanks keeping an eye on the thread I appreciate it

[quoted text clipped - 34 lines]

Thanks mate



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200510/1
  #32  
Old October 17th, 2005, 04:46 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default Integrating the code for a max.date function with a check box controlling it and

Congratulations!

--

Ken Snell
MS ACCESS MVP

"Chris W via AccessMonster.com" u12677@uwe wrote in message
news:55f391158b55c@uwe...
Hi Guys
Sorry about the late reply, don't have access to the net from home.

But the good news is that this morning I have managed to get it working in
all the ways I hoped that it would. I can't thank you both enough; or
everyone from access monster over the last few months. Seriously I would
buy
you guys a beer if I lived in the same state or for that matter the same
country.

Thanks again.

P.S. I am sure that I will be back asking for help when it crashes as soon
as
someone tries to do something I didn't expect.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
More Duplicate E-mails Outlook 2003 John Smith General Discussion 36 January 8th, 2007 06:36 PM
Attn: Ken Snell - Displaying chemical structures in Access Michele General Discussion 11 May 13th, 2005 07:19 PM
Automatically up date time in a cell Mark General Discussion 5 May 12th, 2005 12:26 AM
*Another* OLK 2002 sendmail/SMTP problem steviegb General Discussion 11 March 23rd, 2005 01:59 AM
OLE Object- the real question Michelle Using Forms 18 February 28th, 2005 05:04 AM


All times are GMT +1. The time now is 04:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.