473,386 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Weird Access Database report errors

anoble1
245 128KB
Hi all,

I am running into a weird problem in my MS Access report Database. I created it the other day. It has a general main screen that has a drop down report with 2 limits on it. Well, if you choose the report and go to the first limit and view, nothing comes up every time when you start the DB. But, when you restart the db, and select the report and try the 2nd limit, it works. Then when you try the 1st limit it works.

In order for the 1st limit to work you must open the db. and either run BOTH limits, or run the second limit, let the report open, then close it, then run the first one. I'm not sure whats going on.
The account type is the one giving me problems. I hope I could explain it well enough.

Here is my code, maybe it will be enough.

Expand|Select|Wrap|Line Numbers
  1. Public Function GetWhereCond() As String
  2. Dim whereCond As String
  3.  
  4.     With Forms!frmMain
  5.  
  6.         'These are for Future Reference if I can find where these are stored
  7.         If Nz(!ServiceNumber.Value, "") <> "" Then whereCond = whereCond & " AND (ServiceNumber = " & """" & !ServiceNumber.Value & """" & ")"
  8.         If Nz(!MTWAccount.Value, "") <> "" Then whereCond = whereCond & " AND (ServiceNumber = " & """" & !MTWAccount.Value & """" & ")"
  9.         If Nz(!InvoiceGroup.Value, "") <> "" Then whereCond = whereCond & " AND (ServiceNumber = " & """" & !InvoiceGroup.Value & """" & ")"
  10.         If Nz(!RetailAccount.Value, "") <> "" Then whereCond = whereCond & " AND (ServiceNumber = " & """" & !RetailAccount.Value & """" & ")"
  11.  
  12.         'I haven't decided where to pull the Date Field from so I put in a General Name
  13.         'If Nz(!HighDate, "") <> "" Then whereCond = whereCond & " AND (CUSTOMER.DATE >= #" & !HighDate.Value & "#)"
  14.         'If Nz(!LowDate, "") <> "" Then whereCond = whereCond & " AND (CUSTOMER.DATE <= #" & !LowDate.Value & "#)"
  15.  
  16.         'If Nz(!cmbRegion, "") <> "" Then whereCond = whereCond & " AND (CUSTOMER.CustomerState = '" & !cmbRegion.Value & "')"
  17.         If Nz(!cmbAccountType, "") <> "" Then whereCond = whereCond & " AND (CUSTOMER.AccountType = " & !cmbAccountType.Value & ")"
  18.         If Nz(!cmbAccountStatus, "") <> "" Then whereCond = whereCond & " AND (CUSTOMER.AccountStatus = " & !cmbAccountStatus.Value & ")"
  19.  
  20.  
  21.     End With
  22.  
  23.     If whereCond = "" Then
  24.         GetWhereCond = ""
  25.     Else
  26.         GetWhereCond = "(" & Right(whereCond, Len(whereCond) - 5) & ")"
  27.     End If
  28.  
  29. End Function
PS. Let me add that when I open the db, and select the report and hit view. The report is blank, but if I open it and click on a drop down and clear everything out, it works fine and populates.
May 16 '12 #1
3 1437
NeoPa
32,556 Expert Mod 16PB
No idea what you mean by "limit", which makes it hard to understand the question.
May 17 '12 #2
anoble1
245 128KB
Sorry,

The limits I have are drop down boxes.
May 17 '12 #3
NeoPa
32,556 Expert Mod 16PB
I tried interpreting your explanation with that in mind but it makes no more sense than the first version. If you really want some help then surely it makes sense to put a little more effort into your explanation. I'm happy to help, but not so keen that I want to read through all your code to try to work out what you should have said in the first place - on the off-chance that it all falls into place then. Does that make sense?
May 18 '12 #4

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

Similar topics

0
by: Mikko Pulkkinen | last post by:
Hi, I'm trying to use Crystal Reports to generate reports from an Access database. I'm using VS2003 and C#. I need to select the database the report uses as data source at runtime. The database...
0
by: Bob | last post by:
How can I copy query objects from one MS Access database to another using VB.net. Both databases are on the same computer. As I create a report using vb.net, I create and reference queries in a...
1
by: webmaster | last post by:
I have a password protected Access Database (.MDB) file. I also have a Crystal Report with database fields connected to table in this database. I want to display the Crystal Report Preview Form...
5
by: Bec | last post by:
I'm in desperate need of your help.. I need to build an access database and have NO idea how to do this.. Not even where to start.. It IS for school, and am not asking anyone to do my...
3
by: route_coder | last post by:
I am using access database to create a crystal report in VB.NET Everything works fine when I run on my machine. But when I am deploying it other windows machines. It is asking for database server...
0
by: Danny | last post by:
Hi all, I'm using C# and an Access database. Trying to load a crystal report to the viewer control. And I keep getting the "Login database" dialog at runtime, when the database has a password....
5
by: Linds | last post by:
I have a report within my access database that I would like to have a shortcut on my desktop that could bring up that report. In other words, now I have to double click on the database, then go...
5
by: Cyril044 | last post by:
Hi guys Me again. I just cant seem to get the hang of .NET 2005. I am having a problem with viewing reports. I manage to publish and install my program on the clients machine but now i have...
3
beacon
by: beacon | last post by:
Hi everybody, I'm not sure if this is even possible, but I thought I'd toss it out there since my search results haven't pulled up anything and I'm curious whether or not it can actually be done....
2
by: KMEscherich | last post by:
Hi there, am wondering if there is a way to do the following: I developed a Crystal report that runs against a Clarity table envrionment. The report runs fine. I have been asked to run my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.