Simple If Statement

Jan 31, 2006

Hello,

I have a form based on a table with three controls: txt1, txt2 and txt3. Txt is unbound, while the first two get their source from the table.
I would like that if txt1 is showing data, then txt3 shows the same data of txt2. If this possible?
I have tried something like this but does not work:

If IsNull(Me![txt1]) Then
Me!txt3.Visible = True

If Me!txt1 = "*" Then
Me!txt3 = Me!txt2
End If
End If

View Replies


ADVERTISEMENT

Simple WHERE Statement Help...

Dec 24, 2006

My code abilities are not the best yet...

but I've got this:

="$ " & Sum(tblFinance!Amount WHERE tblFinance.Type="Revenue")

It doesn't work. I'm just trying to display all of the revenues from a table in a sum command. Anyone know how I might be able to fix syntax? thanks!

View 4 Replies View Related

Simple Sql Statement Not Working

Mar 2, 2008

i have an sql statement:

aa = "hello"

Tasklist.RowSource = "SELECT [Tasks].Staff_Name, [Tasks].Project_Title, [Tasks].Percentage_Complete FROM [Tasks] WHERE [Tasks].Date_Allocated < aa ORDER BY [Tasks].Staff_Name;"


how can i make it look the the data i put in "aa" rather than prompt a msg box asking for "aa"?

View 5 Replies View Related

Please Help Me With This Simple Join Statement.

Oct 26, 2005

Hi.

Select Materials.ID, Materials.AvailableUnits, Substances.Name, Suppliers.CompanyName FROM Materials Right Join Substances on Materials.Substance = Substances.ID

This works in joining the substances.name (from substances table) with the value stored in materials.substance (which is ID of substances.ID)

How can I add another Join to join Suppliers.CompanyName with suppliers.ID. The current Materials.Supplier is a key of Suppliers.ID which holds the value of Suppliers.CompanyName. I've tried this a million times and as soon as I insert a second join, no matter what format I get "syntax error in join statement".

PLEASE PLEASE help!

View 3 Replies View Related

Error From Simple Statement

Jun 5, 2007

Okay, now I'm suspecting there's more to this than an overly complicated control source statement....

My summary report contains multiple objects that calculate totals based on a statement in their control source. The report ran fine for a few weeks but all of a sudden it started producing this error:

"The expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables."

I thought perhaps that 12 lengthy control source statements were simply too much for Access to handle, but then I did some testing and eventually removed all but this control source statement: =Sum([NotifType]=9)

That's about as simple as it gets, but when I try and run the report I still get the error. Ggggrrrrrrrrr....

Can anyone tell me what causes this annoying error and how I can get rid of it? (I already compiled.) What little Access quirk am I running into? I will gladly zip the file and post if necessary.

Thank you.

View 10 Replies View Related

Simple Query Statement, Not Getting Anywhere...

Sep 20, 2007

I think this would be a simple query but I have not been successful in getting anything to work at this point. So I thought I would through it out to the pro's here! Thanks for any help you might give.

Table looks like this:
EventID EventDate Score EventType
46 09/20/2007 72 1 Day Net
46 09/20/2007 72 2 Day Net - Day 1
46 09/20/2007 68 1 Day Best Ball
48 07/14/2007 69 1 Day Net
48 07/14/2007 34 Nassau


What I am trying to get from this data is the AVG score, but not include Nassau or Best Ball events. So I have used the Not Like "%Nassau%" etc, in ASP (since ASP requires % rather than * like access. The results I would like to see are one score from each DATE avg'd. That means with this sample data we should get...
46 09/20/2007 72 1 Day Net
48 07/14/2007 69 1 Day Net

Avg score 70.5

I don't care to have the Event Type listed, if that causes grouping issues. I just am not getting anything to work. Thanks for any help.

In short If I could get the avg score using only one score a day that is not a Nassau or Best Ball event, I would have to rejoice! Thanks so much.

View 2 Replies View Related

Modules & VBA :: Simple If Statement Moved To Macro

Jul 29, 2015

I have an open form with buttons to open other forms and use an If statement to position them an example is below.

Code:
Private Sub Command31_Click()
DoCmd.OpenForm "Opener", acNormal
If Me.Frame54 = 1 Then
DoCmd.MoveSize 2500, 1000
ElseIf Me.Frame54 = 2 Then
DoCmd.MoveSize 25500, 1000
End If
End Sub

This works perfectly, however I need to put similar code as a line in a macro and cannot seem to link it.

Code:
Public Function totalmove()
If Forms.Scan_Data.Frame54 = 1 Then
DoCmd.MoveSize 2500, 1000
ElseIf Forms.Scan_Data.Frame54 = 2 Then
DoCmd.MoveSize 24000, 1000
End If
End Function

I get Error 438 object doesn't support this property or method...

View 2 Replies View Related

Queries :: Update Statement For A OUTER JOIN Select Statement

Feb 12, 2014

I have the following Select Statement:

SELECTTenant.ID, Tenant.[First Name], Tenant.[Last Name], Tenant.Address, Tenant.City, Tenant.State, Tenant.Zip, Tenant.[Home Phone], Tenant.[Cell Phone], Tenant.[Work Phone], Tenant.[Rented Unit],
Tenant.[Security Deposit], Tenant.[Move In], Tenant.[Move Out], Tenant.TenantID, Tenant.UnitID, Tenant.PropertyID, Tenant.OwnerID, Owner.Company, Owner.ID AS Expr1, Property.[Property Address],

[code]....

Now, I know that something in the UPDATE statement does not match my select statement.What should my Update Statement be, in order to update all the columns in the joined tables?

View 2 Replies View Related

Queries :: IIF Statement With And In True Statement

Oct 31, 2014

I have a query with the following criteria in one of the fields:

>=DateAdd("m",-12,fom()) And <=DateAdd("m",1,fom())

fom is a function for first of the current month. I need this query to be specific to what month it is when its ran so i want to only have this criteria if the month is > = october. If it isnt October or greater, i want the criteria to reflect this.

>=DateAdd("m",-12,fom()) And <=fom()

Which also works by itself. But when i add it to an iif statement it always produces no results. Below is the iif statement.

Iif(month(date())>=10, >=DateAdd("m",-12,fom()) And <=DateAdd("m",1,fom()),>=DateAdd("m",-12,fom()) And <=fom())

I have also added the column name to each expression and it still doesnt produce any results.

View 4 Replies View Related

Creating IIF Statement In Between Statement For Dates?

Apr 28, 2015

I am creating a multi-search form for a student database, where after I enter my search criteria I hit a "Run Query" command button and then it opens a query form with all of my criteria.So far I can search using last name, first name, and middle name. When I try to search with a start date and end date I am have issues.The start date and end date is for the class date. In the query form under the field, class date, for criteria I wrote:

Between IIf([Forms]![Search Form]![Start Date]="",1/1/10,[Forms]![Search Form]![Start Date]) And IIf([Forms]![Search Form]![End Date]="",4/25/15,[Forms]![Search Form]![End Date])

I want it when I write a date in the start date and end date I want it to give me a list of all the students who took the course between those dates. Also, if I leave the dates blank I want it to search all dates. The dates 1/1/10 and 4/25/15 are just the dates I gave because that is far back as my database goes.

View 11 Replies View Related

Simple Question For A Simple DB

Dec 29, 2006

Ok I am right now making a simple Vendor/Product database to create a line sheet for some sales folks. I have 3 tables: Vendors, Products, and an associate entity Vendors_Products to relate the two. I have a form currently that draws the Vendor Name (primary key) from the Vendor table and the Product Name from the associate entity. This allows me to create new vendors and select current product types from a drop down box. The problem is that the drop down box is too long and it is tiresome when 1 vendor has 10 product types.

Can anyone tell me how to resolve this? I thought it would be better to have option buttons and display all available products. Then you could just click all of the option buttons that apply to that Vendor and it would create the relationships...is this possible?

View 1 Replies View Related

A Simple One For You All

Nov 22, 2005

Hi,
I have looked at some of the threads here and it is clear that many of you are working on a much higher level than me and with a high degree of familiarity with the programme.
I am hoping that someone here is able to give me some advice as I don't find the MS help files digestible.
The task I have is to join 2 databases and produce a table from which I can run a mailmerge.
I have managed to join the 2 databases and I used a customer ID as a common link. (my apologies if the terminology is incorrect)
I now have all the data I require in one table.
THE PROBLEMs I have multiple entries for some of my customers and would like to reduce this to single entries (which is understandable). Please tell me how to do this if you can, and keep it as simple as you can please.

In anticipation I thank you very much.

:-)

View 2 Replies View Related

Simple One But Not For Me!

Jan 14, 2006

Hi there,

I'm making a report detailing competitors final finishing positions in a competition.

The columns are (1) Place, (2) Name and (3) Points

I have the data for their names and the points they have scored, but how do I make the table enter the record number (starting at 1) in the first field???

Thanks in advance
Col

EXAMPLE

PLACE NAME POINTS
1 John Smith 199
2 Ian Jones 90

View 1 Replies View Related

This Should Be Relatively Simple?

Feb 16, 2006

Not sure what the issue is here but i am trying to append a Job number from a main database into two connected databases.
The number is a sequential number i have created and the primary key.
It is an autonumber field(obviously). The format is J0000 and the numbers start from J0001

I am using two different append queries to append them into the external databases tables.
However (and here i think lies the problem) the fields i am inserting them into are text fields with the same format J0000.
When i view the numbers in these tables, they are displayed as J1 or J9. The 0's are missing.
Any ideas.

Thank you in advance

View 10 Replies View Related

This Is Probably Really Simple!

Feb 21, 2006

Hey guys, I'm just wondering how I could limit a field to using from 2 - 20 letters. If I placed the letter "a", I'd get an error saying how at least 2 letters must be there, and a maximum of 20. How would I do this?

Lastly, how can I make it so when I enter data into a form, I can click a button which adds it all into the table?
When I do it normally, it's automatically transferred into the table as I type it into the form.

This is incredibly simple I know, but I am a n00b at Access. ^_^

Thanks guys.

View 2 Replies View Related

Should Be Simple.....

May 18, 2005

OK, I have a strange problem... This doesn't seem to work..... It did... then I made some changes.... Can someone clue me in on what I am doing wrong? A query, simply summing some values in fields... no biggy...... BUT...
The field
TotalHours: ([SundayHours]+[MondayHours]+[TuesdayHours]+[WednesdayHours]+[ThursdayHours]+[FridayHours]+[SaturdayHours])

So why isn't this working?
Can I use a simple VBA statement to sum these fields?


:confused:

View 14 Replies View Related

Simple Qns

Nov 24, 2005

hi all, this is my problem:

i got a table like this

ID time in time out working hours
1
1
2
2
the working hours is [timeput]-[timein]

how to i create a query so that all the ID 1' s working hours will be summed up ?

View 4 Replies View Related

This Should Be Simple

May 15, 2006

:confused: simple query
Critera : <Date()-30 should show records from the last 30 days ???

and : "status"="active" should show records from the last 30 days that are active ????

or am i totally off the mark here ?
vey new to this be gentle :eek:

cheers

View 14 Replies View Related

Probably Something Simple

Oct 18, 2006

I am trying to create an IN query (ACCESS) which will firstly show the customers table (specific details) then the orders details should be in the IN query, I formulated this but it won't work:

SELECT s.CustomerID, Address, City, PostalCode
FROM Customers s
WHERE
s.OrderID IN
(SELECT s.OrderID FROM Orders p
WHERE s.OrderDate = '1996')
AND
s.OrderID IN
(SELECT s.OrderID FROM Orders p
WHERE s.OrderDate = '1997');

Here is the one I did to show the customers and orders who made orders in 1996 and 97:

SELECT Customers.CustomerID AS Customers_CustomerID, Orders.CustomerID AS Orders_CustomerID, Customers.Address, Customers.City, Customers.PostalCode, Orders.OrderID, Orders.OrderDate
FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
WHERE (((Orders.OrderDate) Between #1/1/1996# And #12/31/1997#));



it is probably something simple I am missing here! Sorry to keep asking :(

View 1 Replies View Related

IIf - This Has GOT To Be Simple...

Mar 16, 2007

but I can't seem to figure it out. All I get is Null values when I run the query.

I have a form with a start text box and a end text box. I use the form name sucessfully in the criteria row so I know there is no problem with the form name. I also know there is no problem with the qry name. Does anyone see anything I am doing wrong?!?!

The query I am working in is labeled [qry_old_summary_date_range]. Just wanted to clarify that is not a problem.

1st Pay Increase: IIf([qry_old_summary]![1st Pay Increase]>=[Forms]![Human Resources]![Start] And [qry_old_summary]![1st Pay Increase]<=[Forms]![Human Resources]![End],[qry_old_summary]![1st Pay Increase],Null)

View 1 Replies View Related

This Should Be Simple ...

Mar 30, 2007

and presumably it's only me who's irgorant.

I have a table with dates of deadlines and another with dates of submissions. For each deadline I want to know who submitted first. I figured that all I had to do was compute the difference between the dates and the select the minimum. However, Access rejects the Min() function in the WHERE clause. How do I avoid this?

Thanks a lot !!

View 10 Replies View Related

This Should Be Simple ...

Jun 27, 2007

I have a table (imported from excel) that is a pricing grid for blinds. The header row at the top is widths(mm) and the header row down the left is heights(mm). The data is the price. The import process makes the widths the column names.

height 600 800 1200 ...
300 $60 $80 $100
600 $80 $100 $120
900 $120 $140 $160
.
.
all I want to do is to take that table and make it flattened, like this:

height width price
300 600 $60
300 800 $80
300 1200 $100
600 600 $80
600 800 $100
600 1200 $120
900 600 $120
900 800 $140
900 1200 $160

I can't think how to do this in a query - I could take the flat version and create a crosstab to go the other way. Any clues - I don't want to change too much about the way the imported excel file looks becasue I have no control over that (I already discard miscellaneous heading and junk before I import it)

Hope you can help

View 4 Replies View Related

This Should Be Simple

Jan 15, 2008

My Brain has completely lost all of it's gray matter.

I have two tables tbl_Employers and tbl_Services that are linked via a one to many relationship. Each Employer can have Many Services. The field i am useing in the relationship is EmployerID

If I build a simple select query using these tables I will see all of the employers that have a related record in the services table. Any employer could be listed there many times as per the relationship.

What i want is a simple count of how many employers actually have recieved a service.

Why is this so difficult for me to get my head around.

View 7 Replies View Related

A Simple One! Please Help! :D

Mar 5, 2008

this is my query in design viewhttp://img99.imageshack.us/img99/3095/querytc3.th.gif (http://img99.imageshack.us/my.php?image=querytc3.gif)i use this query when entering datai want to know how i can set it up it display all or any one/two/none of the criteria i put into the question text boxes, number surname and state, or even just number, or just state.anyone?

View 1 Replies View Related

Really Simple One

Mar 12, 2008

this might be a crude roundabout way of doing things
but it works as is, and i'm trying to streamline a little.

i have a database that contains all of my customer's details.
once a month remove those whom no longer want my mailout,
and export the remainder into excel so that my printer can print and stuff envelopes.

i record customers that no longer wish to recieve my mailout, by putting something(anything) in a column that says rts.

what i'm trying to work out is, how in a simple query i can prevent any record that has any value in the rts column from displaying the name/address etc.

if there's a code to say

if anything in rts exists then hide name address state postcode

View 2 Replies View Related

Should Be Simple

Jan 24, 2005

G'Day:

I am working on a simnple form that has just a few simple calculations in it. One being wieght difference and the other being percentage weight difference.

I get Access to calculate the wieght difference easily, but Ican't then get it to calculate a percentage weight difference (in another cell).

This is what I have down for code.

If Weigh1 <> 0 Then
WeightDiff = Weigh1 - Weigh2
End If
If WeightDiff <> 0 Then
PerWeightLoss = WeightDiff / Weigh1
End If

Any Suggestions?

Thanks

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved