473,396 Members | 2,070 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,396 software developers and data experts.

Problem populating text box with query

Lensmeister
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).

Expand|Select|Wrap|Line Numbers
  1. [Home] 
  2. [HG] 
  3. [Away]
  4. [AG]
In the query I am using the table tbl_Matches I have a caluculation that says

Expand|Select|Wrap|Line Numbers
  1. 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.
Feb 18 '09 #1
6 2593
NeoPa
32,556 Expert Mod 16PB
Build the query (qry_WinTeam) to show all the values of the form, then bind the form to this query instead of the table. It will be display only.

Otherwise, have an unbound TextBox which simply uses the same formula to show [HG] or [AG] as selected.
Feb 18 '09 #2
NeoPa
32,556 Expert Mod 16PB
It looks like you may be having problems designing the table structure in a sustainable way (you may find things it can't do for you later because the design has not been properly considered now). I suspect you will want details of what the results of the games were etc. The data needs to be stored at the lowest logical level. This way higher stuff can be deduced using queries etc.

I recommend you take a quick look through Normalisation and Table structures.

PS. Welcome to Bytes! (It seems you don't live a million miles from me :D)
Feb 18 '09 #3
@NeoPa

I have added a textbox. I have added the

Expand|Select|Wrap|Line Numbers
  1. IIF([HG]>[AG],[Home],[Away]) 
What property of the Textbox do I add this to?

I did add it to one (default value) but as I moved from record to record it did not update.

Sorry for sound daft.

I live in Croydon .... :( Thanks for the welcome.
Feb 18 '09 #4
NeoPa
32,556 Expert Mod 16PB
Try (in the Control Source property) :
Expand|Select|Wrap|Line Numbers
  1. =IIf([HG]>[AG],[Home],[Away])
Feb 18 '09 #5
Ok got it now ....

Thanks a lot.

saw the Control Source property now.

Thanks again.

I may have some other daft questions soon enough. LOL
Feb 18 '09 #6
NeoPa
32,556 Expert Mod 16PB
I look forward to seeing them.
Feb 18 '09 #7

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

Similar topics

7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
3
by: Sidney Linkers | last post by:
Hi, I'm trying to make a calculated text field in a query where the textvalue is being populated from multiple records. I already use a VBA function to loop through records and concatenate the...
3
by: ssb | last post by:
Hello, This may be very elementary, but, need help because I am new to access programming. (1) Say, I have a column EMPLOYEE_NAME. How do I fetch (maybe, cursor ?) the values one by one and...
1
by: Roger | last post by:
Hi: Can anyone tell me why my datagrid doesn't populate with query results. For some reason, I get "System.Byte" when I run the following query: Dim oConn As OdbcConnection = New...
3
by: Sean Shanny | last post by:
To all, We are running postgresql 7.4.1 on an G5 with dual procs, OSX 10.3.3 server, 8GB mem, attached to a fully configured 3.5TB XRaid box via fibre channel. I think we have run into this...
12
by: Joel Byrd | last post by:
I'm having a little problem with using type-ahead functionality for an auto-suggest box. Sometimes, when I start to type something and the type-ahead shows up, the AJAX will send a request query...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
3
by: phillip.s.powell | last post by:
I have to produce a query to obtain a single record, however, the tables I work with have a very strange relationship: Table: student Fields: id first_name last_name email school_type_id...
11
by: Ahmedhussain | last post by:
hey everyone... I have a code which gives me this error. Error : Cross-thread operation not valid: Control 'textBox1' accessed from a thread other than the thread it was created on. I am...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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,...

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.