Bind a Textbox in a Form

G

Guest

I have a table containing several Projects and its Phases.

Now I need to create TextBoxes in a Form to return the totals for each
phase. This means I need 3 TextBoxes:

I made a query that Counts the total of projects in each phase:

Query_Projects_Phases

Phase CountOfPhase

Pre-project 1
Portfolio 45
Execution 7

One TextBox would be bound to the "Pre Project" CountOfPhase field from the
query (in this case the TextBox would show1);

the other TextBox would be bound to "Portfolio" CountOfPhase field from the
query
(in this case the TextBox would show 45) and so on...

I don't know how to do this.

Thanks for your time and help.
 
G

Guest

Antonio,

Simply set a form's RecordSource to the name of the query and the
ControlSource of each textbox to the name of the field.

However, it sounds to me like Projects and Phases have a natural one-to-many
relationship, and should be in two tables rather than one:

Projects (One side)
----------------------------------------
ProjectID AutoNumber (PK)
ProjectName Text
Location Text
Manager Integer (Foreign Key to ProjectManagers)
..... other project-specific fields

ProjectPhases (Many side)
----------------------------------------
ProjectPhaseID AutoNumber (PK)
ProjectID Integer (FK to Projects)
PhaseID Integer (FK to Phases)
.... other phase-specific fields

See the following references on database normalization for further
information.

ACC: Database Normalization Basics
http://support.microsoft.com/?id=100139
http://support.microsoft.com/?id=209534
http://support.microsoft.com/?id=283878

Database Normalization Tips by Luke Chung
http://www.fmsinc.com/tpapers/genaccess/databasenorm.html

Support WebCast: Database Normalization Basics
http://support.microsoft.com/default.aspx?scid=/servicedesks/webcasts/wc060600/wcblurb060600.asp

Database Normalization:
http://burks.bton.ac.uk/burks/foldoc/35/28.htm

5 Rules of Database Normalization:
http://www.datamodel.org/NormalizationRules.html

"Understanding Relational Database Design" Document Available in Download
Center:
http://support.microsoft.com/?id=283698
http://support.microsoft.com/?id=164172

ACC2000: "Understanding Relational Database Design"
http://support.microsoft.com/?id=234208

Fundamentals of Relational Database Design:
http://support.microsoft.com/?id=129519

Database Deisgn Principles:
http://msdn.microsoft.com/library/en-us/dndbdes/html/ch04DDP.asp


Sprinks
 
R

Roger Carlson

Make your query the Record Source for the form. To do that, look at the Form
Properties and add your query to the Record Source property. Then bind each
of the text boxes to a field by setting the Control Source property of each
box to the appropriate field in your query.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top