Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / August 2006

Tip: Looking for answers? Try searching our database.

Macro conditions stop macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TomR - 31 Aug 2006 14:15 GMT
I am trying to prevent my append query from executing if the number of
records returned by a query (which is the first macro step) returns more than
one record.
DCount("[Tno]","TrucknoQuery")>1
This works if the criteria for the TrucknoQuery is typed in the query
design. If I promt the user to enter criteria when the query runs, the macro
just stops regardless if the condition is true or false.
Is there some way to do this?
Steve Schapel - 31 Aug 2006 19:58 GMT
Tom,

Could you put an unbound textbox on a form which is open at the time
that the macro is run?  Then you can get the user to enter the query
criteria in there, and in the design of the query, in the place of the
paramater prompt, you refer to the textbox using syntax such as...
 [Forms]![NameOfForm]![NameOfTextbox]

Signature

Steve Schapel, Microsoft Access MVP

> I am trying to prevent my append query from executing if the number of
> records returned by a query (which is the first macro step) returns more than
[quoted text clipped - 4 lines]
> just stops regardless if the condition is true or false.
> Is there some way to do this?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.