473,786 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Not recognizing multiple conditional actions within Macro - Help, please

Hello all...I'm a bit new to working with Macros in Access so forgive
me if the terminology I use is not accurate.

To preface this, basically I am using a form on a replicated database
so the end-user can filter on a specific report they want to see. This
database was designed by my predecessor (of which he left no
documentation) and I need to add some additional functions to this
end-user filter report.

Within one Macro, he has over 30 conditional actions. I have since
added an additional attribute to the database (public
comment/non-public comment). I want to make this an option when
filtering reports. I've added about 5 new conditional actions that
incorporate this and they worked (including the original 30 conditional
actions within the same macro). After I add the sixth conditional
action, the new action works, but then most actions underneath it do
not work (there are no error messages...it just doesn't recognize the
filter constraints).

My question --- could it be the order in which I add these actions? Or
could it be a limitation of Access?

Thank you --- any help would be greatly appreciated. This has been
driving me nuts all weekend. If you think you might be able to help
and need additional info or examples, please let me know and I'll get
them ready. Thank you!!!!

Nov 13 '05 #1
1 2300
Sorry, but this is probably at best an indirect answer to your
question. I almost never use macros, so don't know a whole lot about
them. That said, almost anything you do in a macro, you can do with
VBA, and usually do it better.

If you wanted to, you could convert the macro you have to VBA
(Right-click on the macro, choose Save As, and then choose Module.
Then you can simplify the insane number of this kind of thing:

If Forms![MyForm]![MyField]=1 Then
'Do one thing
End If

If Forms![MyForm]![MyField]=1 Then
'Do another thing
End If

to something like

Select Case Forms![MyForm]![MyField]
Case 1
'do one thing
Case 2
' do another thing
....
Case Else
' do the default thing
End Select

Also, you can build your filters incrementally, by testing a control to
see if it has a value, and if it does, add it to the filter...

If not IsNull(Forms![MyForm]![MyControl]) then
strFilter = strFilter & "[TableName].[FieldName]=
Forms![MyForm]![MyControl]
End if

it just makes building the filters a lot easier. And then at the end
you can just pass the filter you've created with your function to the
open event of your report in the DoCmd.OpenRepor t method...

Hope I haven't totally lost you. You might want to look up the
OpenReport method in the helpfile...

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2110
by: Matt | last post by:
The ASP page has multiple buttons, and when the user clicks different buttons, it will submit the form data to different URLs. My first approach was to use BUTTON type, and triggers javascript function to submit the form data. However, it didn't work properly and I changed to use SUBMIT type. <INPUT TYPE="BUTTON" NAME="action1" VALUE="Return to Main Search Page" onClick="action1()">
13
6114
by: Andrew | last post by:
I use conditional compiler constants, set through the VBA IDE in Tools, <projectname> Properties, that I refer to throughout my code to control which code is used during development, and which during production. Usually, this only wraps code used to control quitting the whole app versus just shutting a form, but it can also control many other things. However, as part of the build before delivering an update, I have to remember to...
3
3847
by: Diana Gard | last post by:
Perhaps this is a design flaw, please let me know. I'm using Access 2000. I have a form with a tab control and 5 subforms within those tabs. The forms match with the tables: Client main, Intake, Financial, Fees, Payments, Bills, Bill Line Items. The design works thusly - Client Main relates to Intake. Intake relates to financial. Financial relates Fees, Payments and Bills. Bills relates to Bill Line Items. On the form, I use the...
0
8778
by: MHenry | last post by:
Hi, I know virtually nothing about creating Macros in Access. I would appreciate some help in creating a Macro or Macros that automatically run(s) 14 Queries (three Make Table Queries, and 11 Append Queries) when the Database is first opened, and then again anytime I invoke the Macro (somehow) after the database is already open. The latter function is useful, because the queries must be rerun every time data is added, deleted, or...
28
2643
by: richardlang | last post by:
Anyone out there ever come across a preprocessor macro that compares an argument value against the predefined __DATE__ macro in order to control conditional compilation based on date. Something along the lines of... # define DateLaterThan(x) ... that could be used for things like
11
3205
by: junky_fellow | last post by:
Hi guys, I have a piece of code: int func(int flag) { int number=1; if (flag == 1) return 0; if(flag == 2)
12
2350
by: code break | last post by:
Hi all, Please can any one tell me the importance of below code... #if 0 /*what is use of this macro conditional.since this is every time false .*/ stmt1 ; #else
4
2572
by: apartain | last post by:
I have a macro with several actions in it. They each have a condition. The macro seems to be working for the first line of action, but not for any of the subsequent actions. Any ideas why this may be and/or how to work around it? Thanks.
0
9496
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9961
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4066
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.