473,387 Members | 1,899 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,387 software developers and data experts.

IF...AND...THEN statements in ACCESS

3
Hi everyone

i cannot figure out how to use the IF..AND...THEN statements.

i have built a report genorater form and one of the slections is to sort a specific reports by either one fo two criteria. i have built two reports and one for each criteria and i am using the code

If [Chckob] = True And [Opt_dep] = true Then
DoCmd.OpenReport "Obstacle Card Comments", acViewPreview, , obwh
End If

one being a check box and one being an option button

which i was hoping it would do but i get a debug error of "you have entered a expression with no value"

can someone please advise what i am doing wrong please
Mar 19 '07 #1
1 1148
willakawill
1,646 1GB
Hi there is no need to use the square brackets in your statement:
Expand|Select|Wrap|Line Numbers
  1. If Chckob = True And Opt_dep = true Then
  2.     DoCmd.OpenReport "Obstacle Card Comments", acViewPreview, , obwh
  3. End If
You can also write it like this:
Expand|Select|Wrap|Line Numbers
  1. If Chckob And Opt_dep Then
  2.     DoCmd.OpenReport "Obstacle Card Comments", acViewPreview, , obwh
  3. End If
Mar 19 '07 #2

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

Similar topics

3
by: Leader | last post by:
Hi All, I am getting slower performance of select statements in MS SQL. I am finding select statements in MS SQL are even slower than MS ACCESS. Is there any way to improve the performance of...
19
by: GMKS | last post by:
Hello all, I have 13 check boxes on a form. I am trying to check all the check boxes to determine if they are true or false when I close the form. At present only the first IF...Then...Else...
7
by: Glenn Davy | last post by:
Hidely hodley everyone I'd like to run a series of of sql ddl statements against an msde2000 server. Normally I just deploy cmd file that impliments as osql statement, but I'd like to store the...
1
by: jan | last post by:
Hello, I am new to this list and would appreciate some help with Access 2000 and Access 2003. I need to export our access database table statements by access database to place into our database...
16
by: klowe | last post by:
Hi, I'm an Access newbie and need to update an Access database from a web application. I'll need to add new records and also update existing ones. What I was thinking of doing is have my web app...
2
by: Annie D via AccessMonster.com | last post by:
Hi, Is it possible to use multiple statements in SQL?? (I’ve never used it before) : I have one query that i'm working with, The statements I want to use are as below, they all work...
12
by: ltanvo | last post by:
Hi, I try to run several insert into sql statements in direct MS access at same time. For ex. INSERT INTO Mytable(F1, F2) VALUES('V11', 'V12') INSERT INTO Mytable(F1, F2) VALUES('V21', 'V22')...
0
by: Gary Herron | last post by:
Ohad Frand wrote: There is no way you can consider 'elif', 'else', 'except', and 'from' statements. However, as someone pointed out, the kwlist from the keyword module is the closest thing we...
0
by: Ohad Frand | last post by:
Hi Thanks a lot for your reply I think the main uses for it is to study the language and to see that I didn't miss anything else or that something is changed from one version to another. The...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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,...
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.