Question Form/Query/Textbox/Table help please.

Lensmeister

Registered User.
Local time
Today, 05:29
Joined
Feb 18, 2009
Messages
65
Hi,
As a newbie here I hope someone cane help me.
I have Acess 2003 and am making a database that holds records or football matches. I haven't created any relationships as yet. The main table is called tbl_Matches and the Primary key is an auto number. In this table I have the following fields I am using in a query (there are other fields in the table but not used in the query).
Code:
[Home] 
[HG] 
[Away]
[AG]
In the query I am using the table tbl_Matches I have a caluculation that says:

Code:
IIF([HG]>[AG],[Home],[Away])

The only column that shows is the answer.
This is producing the correct answer I want.
I have a form (frm_Matches) that has all the fields for the tbl)Meatches on it. Now this is where I get some problems.

I want a textbox to show the result of the Query (qry_WinTeam) to appear in it.

I have tried a few things and am now stuck. Please help if you can.
 
Do a search in here for lots of stuff about leagues, football, baseball, they're all the same in structure terms.
 
Assuming the Query returns a scalar ( a single piece of information), then the easiest way would be a DLookup Function, and the Control source would be =DLookup(........)

However if the query involves more than one table then use a DAO or ADO recordset, place the code in a function, set the function name to the scalar and assign the function as the text box control source.
 

Users who are viewing this thread

Back
Top Bottom