Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is it possible to refer to the recordset option in a macro ms acc 2010

Status
Not open for further replies.

Panchovia

Programmer
May 6, 2010
48
CW
Code
if me.recordset.recordcount = 0 then
cancelevent
else
if me.recordset.recordcount = 1 and me.Amount = 0 then
Docmd.rumcommand accmdundo

Endif

Microsoft recommends you use macros instead of code how do you transform this code in macro

Your help will be highly apprecciated

Pancho





 
How are ya Panchovia . . .
[blue]Microsoft recommends you use macros instead of code ...[/blue]
I find this hard to believe, espcially since the opposite has always been recommended throughout the years.

Macro's are instantiated by a simplified programming language made more for non-programmers. While VBA is full fledged. You can look at macro's as a small subset of VBA ... meaning macro's can't do any where near what VBA can do. So why convert to a lesser language which may not even support the conversion you need. Access even has a menu item to convert macro to VBA ([blue]Tools[/blue] - [blue]Macro[/blue] = [blue]Convert Macros to Visual Basic[/blue]). But there's no menu item to perform the reverse!

If you want to Razzle & Dazzle ... do yourself a favor and stay with VBA. Lean it! ... you'll be glad you did.

[blue]Your Thoughts? . . .[/blue]



See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
You can add Visual Basic for Applications (VBA) code to a Web database; however, you cannot run that code while the database is running in a Web browser. If your Web database contains VBA code, you must first open the Web database by using Access before you can run the code. To perform programming tasks in a Web database, use Access macros instead.
 
Panchovia . . .

Your post origination made no reference to db on the web. So the answer is [blue]mostly No[/blue]. If you run thru the action listing of a new macro you'll see what you can do (very limited). Definitely recordsets are out.

Wish I had better news ...

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
AceMan,

Although I have not seen anything said, it really appears to me that MS is pushing away from VBA and pushing users to macros. I am wondering if there is some big plan to deprecate VBA in the future and replace with something else. Or maybe this is only in the short term to integrate better with Sharepoint.

My observations:
1) The VBA IDE has not changed since I started working with VB. I have been doing a lot of coding in visual studio, and I think the IDE is pretty amazing. It improves with each release. However, None of these features and capabilities have made there way into VBA.

At the same time
2) New wizards write code using macros not vba
3) They have added embedded macros
3) They have greately improved the ease, use, and flexibility of macros including intellisense.
4) They have added Data Macros( triggers)
5) Macros are required for automating forms published through Access Services. VBA code will not run within a browser window, but data and UI macros will.

I just find these trends curious.
 
How are ya MajP . . .

Thanks for the headsup ... I'll be sure to keep an eye/ear out as well. Really Something!

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top