473,654 Members | 3,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help me in correcting the code

8 New Member
Dear Friends,

kindly help me in correcting the following code

This code is for printing the report from the combo box after selection which connects to different reports as selected. I have written this code behind the combo box.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Bank_Name_AfterUpdate()
  2.  
  3. Dim rpt As String
  4.  
  5. rpt = Bank_Name.AfterUpdate()
  6.  
  7. If rpt = "Andhra Bank" Then
  8.    DoCmd.OpenReport "Cheque Printing - Andhra Bank", acPreview
  9.  
  10. ElseIf rpt = "Canara Bank" Then
  11.        DoCmd.OpenReport "Cheque Printing - Canara Bank", acPreview
  12.  
  13. ElseIf rpt = "Central Bank of India" Then
  14.        DoCmd.OpenReport "Cheque Printing - Central Bank of India", acPreview
  15.  
  16. ElseIf rpt = "IDBI Bank" Then
  17.        DoCmd.OpenReport "Cheque Printing - IDBI Bank", acPreview
  18.  
  19. ElseIf rpt = "Indian Overseas Bank" Then
  20.        DoCmd.OpenReport "Cheque Printing - Indian Overseas Bank", acPreview
  21.  
  22. ElseIf rpt = "Indusind Bank" Then
  23.        DoCmd.OpenReport "Cheque Printing - Indusind Bank", acPreview
  24.  
  25. ElseIf rpt = "Ing Vysya Bank" Then
  26.        DoCmd.OpenReport "Cheque Printing - Ing Vysya Bank", acPreview
  27.  
  28. ElseIf rpt = "Union Bank of India" Then
  29.        DoCmd.OpenReport "Cheque Printing - Union Bank of India", acPreview
  30.  
  31. End If
  32.  
  33. End Sub
Please help me in correcting the code and i want whenvever they select the bank name it should go to the report which is created agains that bank.

Help requried urgencly.

Thanks & Regards,

Srinivas
Apr 6 '07 #1
1 1699
Rabbit
12,516 Recognized Expert Moderator MVP
Dear Friends,

kindly help me in correcting the following code

This code is for printing the report from the combo box after selection which connects to different reports as selected. I have written this code behind the combo box.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Bank_Name_AfterUpdate()
  2.  
  3. Dim rpt As String
  4.  
  5. rpt = Bank_Name.AfterUpdate()
  6.  
  7. If rpt = "Andhra Bank" Then
  8.    DoCmd.OpenReport "Cheque Printing - Andhra Bank", acPreview
  9.  
  10. ElseIf rpt = "Canara Bank" Then
  11.        DoCmd.OpenReport "Cheque Printing - Canara Bank", acPreview
  12.  
  13. ElseIf rpt = "Central Bank of India" Then
  14.        DoCmd.OpenReport "Cheque Printing - Central Bank of India", acPreview
  15.  
  16. ElseIf rpt = "IDBI Bank" Then
  17.        DoCmd.OpenReport "Cheque Printing - IDBI Bank", acPreview
  18.  
  19. ElseIf rpt = "Indian Overseas Bank" Then
  20.        DoCmd.OpenReport "Cheque Printing - Indian Overseas Bank", acPreview
  21.  
  22. ElseIf rpt = "Indusind Bank" Then
  23.        DoCmd.OpenReport "Cheque Printing - Indusind Bank", acPreview
  24.  
  25. ElseIf rpt = "Ing Vysya Bank" Then
  26.        DoCmd.OpenReport "Cheque Printing - Ing Vysya Bank", acPreview
  27.  
  28. ElseIf rpt = "Union Bank of India" Then
  29.        DoCmd.OpenReport "Cheque Printing - Union Bank of India", acPreview
  30.  
  31. End If
  32.  
  33. End Sub
Please help me in correcting the code and i want whenvever they select the bank name it should go to the report which is created agains that bank.

Help requried urgencly.

Thanks & Regards,

Srinivas
rpt = Bank_Name.After Update()

That's the problem. You're setting rpt to either [Event Procedure] or the return value of the sub which should create some sort of infinite loop.

What you want to set it to is the value entered in Bank_Name which would be:
rpt = Me.Bank_Name
Apr 6 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
1781
by: James Walker | last post by:
Can some one help I get an error of 'checkIndate' is null or not an object can someone please help. I can't work out why Thanks in advance James <form> <td height="24" colspan="7" valign="top"><form name="booknow"><select
6
5732
by: gsb | last post by:
Don't know if this is the right place to post this JavaScript issue. If not, could someone point me in the right direction please. I am trying to make a "cross browser compliant" floating iFrame. Not real fancy, just load, resize and move. But, I do not have the browsers, OSs and different machines (like Mac) to test the code on. So I need some help to see where this basic example of works and does not work.
5
1404
by: Dave Anderson | last post by:
I've done a bunch of googling and searched all the references I've got without finding anything that seems relevant to this issue; I'd appreciate any useful pointers or constructive comments. I've got a page at <http://www.nesfa.org/rules/code-s1.html> which makes extensive use of anchors within the page. Every other browser I've tried deals with them just fine, but (at least recent versions of) IE acts as though they didn't exist --...
7
1256
by: Emmet Caulfield | last post by:
In the course of examining the code for an Internet-connected authentication server, I came across the following code (twice in one function with different constants in the "if") in a file of some 2000 non-comment lines written by a "C" expert: if( elem->tag == SOME_MANIFEST_CONSTANT ) /* Alt */ { char *tempValue = malloc(32); strcpy(tempValue, elem->value); while( tempValue == '0' )
25
1485
by: nichas | last post by:
what does this part of the code mean.. iam not getting it.. ............ typedef int RowArray; RowArray *rptr; ............... i didnt get this.. please reply fast...thank you.
2
7245
by: | last post by:
Help! I'm new to c++, and am breaking my teeth on MS Visual C++ (bundled within Visual Studio .NET 2003). Am trying to link simple c++ code to fortran dlls created in Compaq Visual Fortran (v6.1). Posts concerning this topic are common, but none of the posted solutions I've tried work correctly with the above software. The linker can't seem to find the dll (reports 'unresolved external symbol __imp__IMSL_FUN@8'; IMSL_FUN.dll is the f77...
10
2091
by: Frank | last post by:
I've done this a few times. In a solution I have a project, Say P1, and need another project that will contain much code that is similar to that of P1. I hope no one gets hung up on why I don't somehow share the code. So, I copy the folder P1 is in, change the new folder name, and is VS2005 to change all occurrences of P1's name tp P2's name.
6
2130
by: JamesG | last post by:
I'm trying to convert a unix timestamp to a readable time, such as 4 hours ago, or 25 minutes ago. My code is below: function ago($ts) { /* time difference */ $ts = (time() - $ts); if($ts < 60) { /* <1 minute */
12
2338
by: iahamed | last post by:
Hi Everyone, I got two parts of my advance search to work, I am running out of Logic to connect the third. My mind is in swing! Pleaseeeeeeeee Help me. I have 3 Fiels to search, the First two works, thats: 1. Category to search from the (Drop down name: ASPDBCatSearch) is working with the Input Text Box Field (name: keyword), based on Whatever selection on the Drop down value selection:
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
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
8815
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
8482
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
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4149
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
2714
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
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
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.