A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Link a text box to combo boxes on a form.



 
 
Thread Tools Display Modes
  #1  
Old December 13th, 2006, 04:41 PM posted to microsoft.public.access.forms
Mark
external usenet poster
 
Posts: 1,534
Default Link a text box to combo boxes on a form.

I have a form that has a combo box which is linked to a Query. The field it
is linked to in the Query is titled "PROJECTS" ,without quotes of course
(which contains the titles of all the projects I am working on).

Also there is a Subform on this Form which is linked to a Query titled
"Query for FCR form" (which contains the change order information for all the
projects).

So now when I chose a job in the Combo Box, all the information for the
particular job populate in the subform.

What I would like to see on this form now is the project estimate which is
on its own Query.

I put a textbox in the form which Im attempting to link to a field in the
Project Estimate query and also link it to the combo box I mentioned.

So basically, I want to be able to chose a job in the combo box.....have all
the change order information show up (which is what I have thus far), but I
ALSO want to have the project estimate show up in a text box off to the side.

here are the queries in question:

combo box row source is - "Query for FCR Form"...without quotes..(this
gives me my list of projects)

"Project Estimate" ..without quotes..this query has the project estimates
listed in a field titled Phase 1 and 2 combined

im sure that the textbox has to be linked between these two
queries...correct??

Can someone please help?

Mark



  #2  
Old December 14th, 2006, 02:24 PM posted to microsoft.public.access.forms
Sprinks
external usenet poster
 
Posts: 531
Default Link a text box to combo boxes on a form.

Mark,

Textboxes do not "link", they *display* information--either a field in the
form's underlying RecordSource, or the result of an expression.

What table(s) are involved in the "Project Estimate" query? If they are
fields in your Projects table, from which your main form is derived,
presumably, simply add them to your main form query, and place bound controls
on the main form.

If they are in a 2nd table, in order to relate the estimate to the project,
you need to have the main table's Primary Key as a field (called a foreign
key in the second table). Then create a subform based on the ProjectEstimate
query (be sure to include the foreign key as a field in the query) and set
the subform's LinkMasterFields and LinkChildFields properties to the name of
the linking field in the main and subform, respectively.

Hope that helps.
Sprinks




"mark" wrote:

I have a form that has a combo box which is linked to a Query. The field it
is linked to in the Query is titled "PROJECTS" ,without quotes of course
(which contains the titles of all the projects I am working on).

Also there is a Subform on this Form which is linked to a Query titled
"Query for FCR form" (which contains the change order information for all the
projects).

So now when I chose a job in the Combo Box, all the information for the
particular job populate in the subform.

What I would like to see on this form now is the project estimate which is
on its own Query.

I put a textbox in the form which Im attempting to link to a field in the
Project Estimate query and also link it to the combo box I mentioned.

So basically, I want to be able to chose a job in the combo box.....have all
the change order information show up (which is what I have thus far), but I
ALSO want to have the project estimate show up in a text box off to the side.

here are the queries in question:

combo box row source is - "Query for FCR Form"...without quotes..(this
gives me my list of projects)

"Project Estimate" ..without quotes..this query has the project estimates
listed in a field titled Phase 1 and 2 combined

im sure that the textbox has to be linked between these two
queries...correct??

Can someone please help?

Mark



  #3  
Old December 14th, 2006, 05:45 PM posted to microsoft.public.access.forms
Mark
external usenet poster
 
Posts: 1,534
Default Link a text box to combo boxes on a form.

clear as mud..hahaha...thanx for your help but I did not figure it out yet.
The table involved in the Project Estimate is a table titled Raw Data
CUI......and I want the textbox to display the field called "Estimate" in the
Project Estimate Query.

the textbox is in the form.....when I chose a project in the combo box I
would like to see estimate displeyd in a textbox.

Im trying all kinds of expressions in the properties window of the text
box....still cant figure it out yet.

"Sprinks" wrote:

Mark,

Textboxes do not "link", they *display* information--either a field in the
form's underlying RecordSource, or the result of an expression.

What table(s) are involved in the "Project Estimate" query? If they are
fields in your Projects table, from which your main form is derived,
presumably, simply add them to your main form query, and place bound controls
on the main form.

If they are in a 2nd table, in order to relate the estimate to the project,
you need to have the main table's Primary Key as a field (called a foreign
key in the second table). Then create a subform based on the ProjectEstimate
query (be sure to include the foreign key as a field in the query) and set
the subform's LinkMasterFields and LinkChildFields properties to the name of
the linking field in the main and subform, respectively.

Hope that helps.
Sprinks




"mark" wrote:

I have a form that has a combo box which is linked to a Query. The field it
is linked to in the Query is titled "PROJECTS" ,without quotes of course
(which contains the titles of all the projects I am working on).

Also there is a Subform on this Form which is linked to a Query titled
"Query for FCR form" (which contains the change order information for all the
projects).

So now when I chose a job in the Combo Box, all the information for the
particular job populate in the subform.

What I would like to see on this form now is the project estimate which is
on its own Query.

I put a textbox in the form which Im attempting to link to a field in the
Project Estimate query and also link it to the combo box I mentioned.

So basically, I want to be able to chose a job in the combo box.....have all
the change order information show up (which is what I have thus far), but I
ALSO want to have the project estimate show up in a text box off to the side.

here are the queries in question:

combo box row source is - "Query for FCR Form"...without quotes..(this
gives me my list of projects)

"Project Estimate" ..without quotes..this query has the project estimates
listed in a field titled Phase 1 and 2 combined

im sure that the textbox has to be linked between these two
queries...correct??

Can someone please help?

Mark



  #4  
Old December 14th, 2006, 06:25 PM posted to microsoft.public.access.forms
Sprinks
external usenet poster
 
Posts: 531
Default Link a text box to combo boxes on a form.

Mark,

How is the RecordSource of your main form related to Raw Data CUI? Do they
have a common field? If they do, place a subform on the main form linked by
the common field. By "linked", I mean setting the subform's LinkMasterFields
and LinkChildFields properties.

Alternatively, you could use the DLookup function as the ControlSource for a
main form textbox:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " &
Me![YourProjectNumberControl])

This presumes that your matching field in the Raw Data CUI is named
ProjectNumber, and that it is a number. If it's text, you need single quotes
around the value:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " & "'" &
Me![YourProjectNumberControl] & "'")

Sprinks



"mark" wrote:

clear as mud..hahaha...thanx for your help but I did not figure it out yet.
The table involved in the Project Estimate is a table titled Raw Data
CUI......and I want the textbox to display the field called "Estimate" in the
Project Estimate Query.

the textbox is in the form.....when I chose a project in the combo box I
would like to see estimate displeyd in a textbox.

Im trying all kinds of expressions in the properties window of the text
box....still cant figure it out yet.

"Sprinks" wrote:

Mark,

Textboxes do not "link", they *display* information--either a field in the
form's underlying RecordSource, or the result of an expression.

What table(s) are involved in the "Project Estimate" query? If they are
fields in your Projects table, from which your main form is derived,
presumably, simply add them to your main form query, and place bound controls
on the main form.

If they are in a 2nd table, in order to relate the estimate to the project,
you need to have the main table's Primary Key as a field (called a foreign
key in the second table). Then create a subform based on the ProjectEstimate
query (be sure to include the foreign key as a field in the query) and set
the subform's LinkMasterFields and LinkChildFields properties to the name of
the linking field in the main and subform, respectively.

Hope that helps.
Sprinks




"mark" wrote:

I have a form that has a combo box which is linked to a Query. The field it
is linked to in the Query is titled "PROJECTS" ,without quotes of course
(which contains the titles of all the projects I am working on).

Also there is a Subform on this Form which is linked to a Query titled
"Query for FCR form" (which contains the change order information for all the
projects).

So now when I chose a job in the Combo Box, all the information for the
particular job populate in the subform.

What I would like to see on this form now is the project estimate which is
on its own Query.

I put a textbox in the form which Im attempting to link to a field in the
Project Estimate query and also link it to the combo box I mentioned.

So basically, I want to be able to chose a job in the combo box.....have all
the change order information show up (which is what I have thus far), but I
ALSO want to have the project estimate show up in a text box off to the side.

here are the queries in question:

combo box row source is - "Query for FCR Form"...without quotes..(this
gives me my list of projects)

"Project Estimate" ..without quotes..this query has the project estimates
listed in a field titled Phase 1 and 2 combined

im sure that the textbox has to be linked between these two
queries...correct??

Can someone please help?

Mark



  #5  
Old December 14th, 2006, 06:59 PM posted to microsoft.public.access.forms
Mark
external usenet poster
 
Posts: 1,534
Default Link a text box to combo boxes on a form.

ok....i tried both expressions and neither work..but i do not think i gave
enough (or proper info)....lited is all the vital info im dealing with:

In the Form ...the combo box is linked (in the "row source" area of
properties window) to a query called "Query from FCR Form" without quotes of
course. the title of the combo box is called PROJECT.

The textbox in the form needs to display values from a query titled Shell &
Motiva...the field that holds the estimated cost is titled ESTIMATE in this
Shell & Motiva query......this query is pulling info from a table titled Work
Package Raw Data

so basically when I chose a project from the combo box the estimate for that
project will be displayed in the textbox.

I hope that is more clear......Im trying all your expressions with the
correct titles of course and I get the "#name" message.

"Sprinks" wrote:

Mark,

How is the RecordSource of your main form related to Raw Data CUI? Do they
have a common field? If they do, place a subform on the main form linked by
the common field. By "linked", I mean setting the subform's LinkMasterFields
and LinkChildFields properties.

Alternatively, you could use the DLookup function as the ControlSource for a
main form textbox:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " &
Me![YourProjectNumberControl])

This presumes that your matching field in the Raw Data CUI is named
ProjectNumber, and that it is a number. If it's text, you need single quotes
around the value:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " & "'" &
Me![YourProjectNumberControl] & "'")

Sprinks



"mark" wrote:

clear as mud..hahaha...thanx for your help but I did not figure it out yet.
The table involved in the Project Estimate is a table titled Raw Data
CUI......and I want the textbox to display the field called "Estimate" in the
Project Estimate Query.

the textbox is in the form.....when I chose a project in the combo box I
would like to see estimate displeyd in a textbox.

Im trying all kinds of expressions in the properties window of the text
box....still cant figure it out yet.

"Sprinks" wrote:

Mark,

Textboxes do not "link", they *display* information--either a field in the
form's underlying RecordSource, or the result of an expression.

What table(s) are involved in the "Project Estimate" query? If they are
fields in your Projects table, from which your main form is derived,
presumably, simply add them to your main form query, and place bound controls
on the main form.

If they are in a 2nd table, in order to relate the estimate to the project,
you need to have the main table's Primary Key as a field (called a foreign
key in the second table). Then create a subform based on the ProjectEstimate
query (be sure to include the foreign key as a field in the query) and set
the subform's LinkMasterFields and LinkChildFields properties to the name of
the linking field in the main and subform, respectively.

Hope that helps.
Sprinks




"mark" wrote:

I have a form that has a combo box which is linked to a Query. The field it
is linked to in the Query is titled "PROJECTS" ,without quotes of course
(which contains the titles of all the projects I am working on).

Also there is a Subform on this Form which is linked to a Query titled
"Query for FCR form" (which contains the change order information for all the
projects).

So now when I chose a job in the Combo Box, all the information for the
particular job populate in the subform.

What I would like to see on this form now is the project estimate which is
on its own Query.

I put a textbox in the form which Im attempting to link to a field in the
Project Estimate query and also link it to the combo box I mentioned.

So basically, I want to be able to chose a job in the combo box.....have all
the change order information show up (which is what I have thus far), but I
ALSO want to have the project estimate show up in a text box off to the side.

here are the queries in question:

combo box row source is - "Query for FCR Form"...without quotes..(this
gives me my list of projects)

"Project Estimate" ..without quotes..this query has the project estimates
listed in a field titled Phase 1 and 2 combined

im sure that the textbox has to be linked between these two
queries...correct??

Can someone please help?

Mark



  #6  
Old December 14th, 2006, 07:06 PM posted to microsoft.public.access.forms
Sprinks
external usenet poster
 
Posts: 531
Default Link a text box to combo boxes on a form.

Mark,

My bad. Try the expression preceded by the equal sign:

=DLookup("[FieldYou'reLookingUp]", "SourceTableorQuery", "[LinkingField] = "
& Me![ControlOnCurrentFormWithLinkingFieldData])


Sprinks

"mark" wrote:

ok....i tried both expressions and neither work..but i do not think i gave
enough (or proper info)....lited is all the vital info im dealing with:

In the Form ...the combo box is linked (in the "row source" area of
properties window) to a query called "Query from FCR Form" without quotes of
course. the title of the combo box is called PROJECT.

The textbox in the form needs to display values from a query titled Shell &
Motiva...the field that holds the estimated cost is titled ESTIMATE in this
Shell & Motiva query......this query is pulling info from a table titled Work
Package Raw Data

so basically when I chose a project from the combo box the estimate for that
project will be displayed in the textbox.

I hope that is more clear......Im trying all your expressions with the
correct titles of course and I get the "#name" message.

"Sprinks" wrote:

Mark,

How is the RecordSource of your main form related to Raw Data CUI? Do they
have a common field? If they do, place a subform on the main form linked by
the common field. By "linked", I mean setting the subform's LinkMasterFields
and LinkChildFields properties.

Alternatively, you could use the DLookup function as the ControlSource for a
main form textbox:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " &
Me![YourProjectNumberControl])

This presumes that your matching field in the Raw Data CUI is named
ProjectNumber, and that it is a number. If it's text, you need single quotes
around the value:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " & "'" &
Me![YourProjectNumberControl] & "'")

Sprinks



"mark" wrote:

clear as mud..hahaha...thanx for your help but I did not figure it out yet.
The table involved in the Project Estimate is a table titled Raw Data
CUI......and I want the textbox to display the field called "Estimate" in the
Project Estimate Query.

the textbox is in the form.....when I chose a project in the combo box I
would like to see estimate displeyd in a textbox.

Im trying all kinds of expressions in the properties window of the text
box....still cant figure it out yet.

"Sprinks" wrote:

Mark,

Textboxes do not "link", they *display* information--either a field in the
form's underlying RecordSource, or the result of an expression.

What table(s) are involved in the "Project Estimate" query? If they are
fields in your Projects table, from which your main form is derived,
presumably, simply add them to your main form query, and place bound controls
on the main form.

If they are in a 2nd table, in order to relate the estimate to the project,
you need to have the main table's Primary Key as a field (called a foreign
key in the second table). Then create a subform based on the ProjectEstimate
query (be sure to include the foreign key as a field in the query) and set
the subform's LinkMasterFields and LinkChildFields properties to the name of
the linking field in the main and subform, respectively.

Hope that helps.
Sprinks




"mark" wrote:

I have a form that has a combo box which is linked to a Query. The field it
is linked to in the Query is titled "PROJECTS" ,without quotes of course
(which contains the titles of all the projects I am working on).

Also there is a Subform on this Form which is linked to a Query titled
"Query for FCR form" (which contains the change order information for all the
projects).

So now when I chose a job in the Combo Box, all the information for the
particular job populate in the subform.

What I would like to see on this form now is the project estimate which is
on its own Query.

I put a textbox in the form which Im attempting to link to a field in the
Project Estimate query and also link it to the combo box I mentioned.

So basically, I want to be able to chose a job in the combo box.....have all
the change order information show up (which is what I have thus far), but I
ALSO want to have the project estimate show up in a text box off to the side.

here are the queries in question:

combo box row source is - "Query for FCR Form"...without quotes..(this
gives me my list of projects)

"Project Estimate" ..without quotes..this query has the project estimates
listed in a field titled Phase 1 and 2 combined

im sure that the textbox has to be linked between these two
queries...correct??

Can someone please help?

Mark



  #7  
Old December 14th, 2006, 07:41 PM posted to microsoft.public.access.forms
Mark
external usenet poster
 
Posts: 1,534
Default Link a text box to combo boxes on a form.

here is what I put in the Control Source section of the Textbox window in the
form:
=DLookup("[Estimate]","Shell & Motiva","[Project]="&Me![Project])

in order of appearence of equation:

Estimate being the field items I need displayed in the textbox (as a project
is chosen with combo box)
Shell & Motiva being the query that contains the field mentioned above that
has the estimates
Project being the field that is reperated in tables and queries...the common
link
the last "Project" listed in the equation is the name of the combo box on
the form.

no spaces in any of the equation..9except the spaces in the field names or
query names

I still get the #name?

this is some frustrating stuff..hahahaha

"Sprinks" wrote:

Mark,

My bad. Try the expression preceded by the equal sign:

=DLookup("[FieldYou'reLookingUp]", "SourceTableorQuery", "[LinkingField] = "
& Me![ControlOnCurrentFormWithLinkingFieldData])


Sprinks

"mark" wrote:

ok....i tried both expressions and neither work..but i do not think i gave
enough (or proper info)....lited is all the vital info im dealing with:

In the Form ...the combo box is linked (in the "row source" area of
properties window) to a query called "Query from FCR Form" without quotes of
course. the title of the combo box is called PROJECT.

The textbox in the form needs to display values from a query titled Shell &
Motiva...the field that holds the estimated cost is titled ESTIMATE in this
Shell & Motiva query......this query is pulling info from a table titled Work
Package Raw Data

so basically when I chose a project from the combo box the estimate for that
project will be displayed in the textbox.

I hope that is more clear......Im trying all your expressions with the
correct titles of course and I get the "#name" message.

"Sprinks" wrote:

Mark,

How is the RecordSource of your main form related to Raw Data CUI? Do they
have a common field? If they do, place a subform on the main form linked by
the common field. By "linked", I mean setting the subform's LinkMasterFields
and LinkChildFields properties.

Alternatively, you could use the DLookup function as the ControlSource for a
main form textbox:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " &
Me![YourProjectNumberControl])

This presumes that your matching field in the Raw Data CUI is named
ProjectNumber, and that it is a number. If it's text, you need single quotes
around the value:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " & "'" &
Me![YourProjectNumberControl] & "'")

Sprinks



"mark" wrote:

clear as mud..hahaha...thanx for your help but I did not figure it out yet.
The table involved in the Project Estimate is a table titled Raw Data
CUI......and I want the textbox to display the field called "Estimate" in the
Project Estimate Query.

the textbox is in the form.....when I chose a project in the combo box I
would like to see estimate displeyd in a textbox.

Im trying all kinds of expressions in the properties window of the text
box....still cant figure it out yet.

"Sprinks" wrote:

Mark,

Textboxes do not "link", they *display* information--either a field in the
form's underlying RecordSource, or the result of an expression.

What table(s) are involved in the "Project Estimate" query? If they are
fields in your Projects table, from which your main form is derived,
presumably, simply add them to your main form query, and place bound controls
on the main form.

If they are in a 2nd table, in order to relate the estimate to the project,
you need to have the main table's Primary Key as a field (called a foreign
key in the second table). Then create a subform based on the ProjectEstimate
query (be sure to include the foreign key as a field in the query) and set
the subform's LinkMasterFields and LinkChildFields properties to the name of
the linking field in the main and subform, respectively.

Hope that helps.
Sprinks




"mark" wrote:

I have a form that has a combo box which is linked to a Query. The field it
is linked to in the Query is titled "PROJECTS" ,without quotes of course
(which contains the titles of all the projects I am working on).

Also there is a Subform on this Form which is linked to a Query titled
"Query for FCR form" (which contains the change order information for all the
projects).

So now when I chose a job in the Combo Box, all the information for the
particular job populate in the subform.

What I would like to see on this form now is the project estimate which is
on its own Query.

I put a textbox in the form which Im attempting to link to a field in the
Project Estimate query and also link it to the combo box I mentioned.

So basically, I want to be able to chose a job in the combo box.....have all
the change order information show up (which is what I have thus far), but I
ALSO want to have the project estimate show up in a text box off to the side.

here are the queries in question:

combo box row source is - "Query for FCR Form"...without quotes..(this
gives me my list of projects)

"Project Estimate" ..without quotes..this query has the project estimates
listed in a field titled Phase 1 and 2 combined

im sure that the textbox has to be linked between these two
queries...correct??

Can someone please help?

Mark



  #8  
Old December 14th, 2006, 08:05 PM posted to microsoft.public.access.forms
Sprinks
external usenet poster
 
Posts: 531
Default Link a text box to combo boxes on a form.

Mark,

Think of it as an opportunity.

Possible errors:
- "Shell & Motiva" is not a valid query name
- "Project" or "Estimate" are not fields in the Shell & Motiva query.
Perhaps they're called "ProjectID" or something else
- "Project" is not the name of your form control in the expression
"Me![Project]". Check the Name property; perhaps it's named "txtProject" or
"ProjectID"
- "Project" is a text field

There should also be a space on either side of the concatenation operator,
although I think Access would correct this:

"[Project]=" & Me![Project]

If it's not one of these, my only guess (no data to support it, just a
feeling) is that, since the ampersand is an operator, using it as character
in a query name is causing the error. You could try renaming the query.

If all else fails, the subform approach should be straightforward.

Sprinks


"mark" wrote:

here is what I put in the Control Source section of the Textbox window in the
form:
=DLookup("[Estimate]","Shell & Motiva","[Project]="&Me![Project])

in order of appearence of equation:

Estimate being the field items I need displayed in the textbox (as a project
is chosen with combo box)
Shell & Motiva being the query that contains the field mentioned above that
has the estimates
Project being the field that is reperated in tables and queries...the common
link
the last "Project" listed in the equation is the name of the combo box on
the form.

no spaces in any of the equation..9except the spaces in the field names or
query names

I still get the #name?

this is some frustrating stuff..hahahaha

"Sprinks" wrote:

Mark,

My bad. Try the expression preceded by the equal sign:

=DLookup("[FieldYou'reLookingUp]", "SourceTableorQuery", "[LinkingField] = "
& Me![ControlOnCurrentFormWithLinkingFieldData])


Sprinks

"mark" wrote:

ok....i tried both expressions and neither work..but i do not think i gave
enough (or proper info)....lited is all the vital info im dealing with:

In the Form ...the combo box is linked (in the "row source" area of
properties window) to a query called "Query from FCR Form" without quotes of
course. the title of the combo box is called PROJECT.

The textbox in the form needs to display values from a query titled Shell &
Motiva...the field that holds the estimated cost is titled ESTIMATE in this
Shell & Motiva query......this query is pulling info from a table titled Work
Package Raw Data

so basically when I chose a project from the combo box the estimate for that
project will be displayed in the textbox.

I hope that is more clear......Im trying all your expressions with the
correct titles of course and I get the "#name" message.

"Sprinks" wrote:

Mark,

How is the RecordSource of your main form related to Raw Data CUI? Do they
have a common field? If they do, place a subform on the main form linked by
the common field. By "linked", I mean setting the subform's LinkMasterFields
and LinkChildFields properties.

Alternatively, you could use the DLookup function as the ControlSource for a
main form textbox:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " &
Me![YourProjectNumberControl])

This presumes that your matching field in the Raw Data CUI is named
ProjectNumber, and that it is a number. If it's text, you need single quotes
around the value:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " & "'" &
Me![YourProjectNumberControl] & "'")

Sprinks



"mark" wrote:

clear as mud..hahaha...thanx for your help but I did not figure it out yet.
The table involved in the Project Estimate is a table titled Raw Data
CUI......and I want the textbox to display the field called "Estimate" in the
Project Estimate Query.

the textbox is in the form.....when I chose a project in the combo box I
would like to see estimate displeyd in a textbox.

Im trying all kinds of expressions in the properties window of the text
box....still cant figure it out yet.

"Sprinks" wrote:

Mark,

Textboxes do not "link", they *display* information--either a field in the
form's underlying RecordSource, or the result of an expression.

What table(s) are involved in the "Project Estimate" query? If they are
fields in your Projects table, from which your main form is derived,
presumably, simply add them to your main form query, and place bound controls
on the main form.

If they are in a 2nd table, in order to relate the estimate to the project,
you need to have the main table's Primary Key as a field (called a foreign
key in the second table). Then create a subform based on the ProjectEstimate
query (be sure to include the foreign key as a field in the query) and set
the subform's LinkMasterFields and LinkChildFields properties to the name of
the linking field in the main and subform, respectively.

Hope that helps.
Sprinks




"mark" wrote:

I have a form that has a combo box which is linked to a Query. The field it
is linked to in the Query is titled "PROJECTS" ,without quotes of course
(which contains the titles of all the projects I am working on).

Also there is a Subform on this Form which is linked to a Query titled
"Query for FCR form" (which contains the change order information for all the
projects).

So now when I chose a job in the Combo Box, all the information for the
particular job populate in the subform.

What I would like to see on this form now is the project estimate which is
on its own Query.

I put a textbox in the form which Im attempting to link to a field in the
Project Estimate query and also link it to the combo box I mentioned.

So basically, I want to be able to chose a job in the combo box.....have all
the change order information show up (which is what I have thus far), but I
ALSO want to have the project estimate show up in a text box off to the side.

here are the queries in question:

combo box row source is - "Query for FCR Form"...without quotes..(this
gives me my list of projects)

"Project Estimate" ..without quotes..this query has the project estimates
listed in a field titled Phase 1 and 2 combined

im sure that the textbox has to be linked between these two
queries...correct??

Can someone please help?

Mark



  #9  
Old December 14th, 2006, 08:36 PM posted to microsoft.public.access.forms
Mark
external usenet poster
 
Posts: 1,534
Default Link a text box to combo boxes on a form.

i swear im about to pull my hair out!!..hahaha

i checked and double checked the titles; names; spaces; etc. and im still
getting the #name?

and yes, Project is a text field. it lists the names of projects like
P035085 or E-1994 Tube.....or PV-961...things like that

heres my personal email if you care to continue without using the ms forums:


"Sprinks" wrote:

Mark,

Think of it as an opportunity.

Possible errors:
- "Shell & Motiva" is not a valid query name
- "Project" or "Estimate" are not fields in the Shell & Motiva query.
Perhaps they're called "ProjectID" or something else
- "Project" is not the name of your form control in the expression
"Me![Project]". Check the Name property; perhaps it's named "txtProject" or
"ProjectID"
- "Project" is a text field

There should also be a space on either side of the concatenation operator,
although I think Access would correct this:

"[Project]=" & Me![Project]

If it's not one of these, my only guess (no data to support it, just a
feeling) is that, since the ampersand is an operator, using it as character
in a query name is causing the error. You could try renaming the query.

If all else fails, the subform approach should be straightforward.

Sprinks


"mark" wrote:

here is what I put in the Control Source section of the Textbox window in the
form:
=DLookup("[Estimate]","Shell & Motiva","[Project]="&Me![Project])

in order of appearence of equation:

Estimate being the field items I need displayed in the textbox (as a project
is chosen with combo box)
Shell & Motiva being the query that contains the field mentioned above that
has the estimates
Project being the field that is reperated in tables and queries...the common
link
the last "Project" listed in the equation is the name of the combo box on
the form.

no spaces in any of the equation..9except the spaces in the field names or
query names

I still get the #name?

this is some frustrating stuff..hahahaha

"Sprinks" wrote:

Mark,

My bad. Try the expression preceded by the equal sign:

=DLookup("[FieldYou'reLookingUp]", "SourceTableorQuery", "[LinkingField] = "
& Me![ControlOnCurrentFormWithLinkingFieldData])


Sprinks

"mark" wrote:

ok....i tried both expressions and neither work..but i do not think i gave
enough (or proper info)....lited is all the vital info im dealing with:

In the Form ...the combo box is linked (in the "row source" area of
properties window) to a query called "Query from FCR Form" without quotes of
course. the title of the combo box is called PROJECT.

The textbox in the form needs to display values from a query titled Shell &
Motiva...the field that holds the estimated cost is titled ESTIMATE in this
Shell & Motiva query......this query is pulling info from a table titled Work
Package Raw Data

so basically when I chose a project from the combo box the estimate for that
project will be displayed in the textbox.

I hope that is more clear......Im trying all your expressions with the
correct titles of course and I get the "#name" message.

"Sprinks" wrote:

Mark,

How is the RecordSource of your main form related to Raw Data CUI? Do they
have a common field? If they do, place a subform on the main form linked by
the common field. By "linked", I mean setting the subform's LinkMasterFields
and LinkChildFields properties.

Alternatively, you could use the DLookup function as the ControlSource for a
main form textbox:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " &
Me![YourProjectNumberControl])

This presumes that your matching field in the Raw Data CUI is named
ProjectNumber, and that it is a number. If it's text, you need single quotes
around the value:

DLookup("[Estimate]", "Raw Data CUI", "[ProjectNumber] = " & "'" &
Me![YourProjectNumberControl] & "'")

Sprinks



"mark" wrote:

clear as mud..hahaha...thanx for your help but I did not figure it out yet.
The table involved in the Project Estimate is a table titled Raw Data
CUI......and I want the textbox to display the field called "Estimate" in the
Project Estimate Query.

the textbox is in the form.....when I chose a project in the combo box I
would like to see estimate displeyd in a textbox.

Im trying all kinds of expressions in the properties window of the text
box....still cant figure it out yet.

"Sprinks" wrote:

Mark,

Textboxes do not "link", they *display* information--either a field in the
form's underlying RecordSource, or the result of an expression.

What table(s) are involved in the "Project Estimate" query? If they are
fields in your Projects table, from which your main form is derived,
presumably, simply add them to your main form query, and place bound controls
on the main form.

If they are in a 2nd table, in order to relate the estimate to the project,
you need to have the main table's Primary Key as a field (called a foreign
key in the second table). Then create a subform based on the ProjectEstimate
query (be sure to include the foreign key as a field in the query) and set
the subform's LinkMasterFields and LinkChildFields properties to the name of
the linking field in the main and subform, respectively.

Hope that helps.
Sprinks




"mark" wrote:

I have a form that has a combo box which is linked to a Query. The field it
is linked to in the Query is titled "PROJECTS" ,without quotes of course
(which contains the titles of all the projects I am working on).

Also there is a Subform on this Form which is linked to a Query titled
"Query for FCR form" (which contains the change order information for all the
projects).

So now when I chose a job in the Combo Box, all the information for the
particular job populate in the subform.

What I would like to see on this form now is the project estimate which is
on its own Query.

I put a textbox in the form which Im attempting to link to a field in the
Project Estimate query and also link it to the combo box I mentioned.

So basically, I want to be able to chose a job in the combo box.....have all
the change order information show up (which is what I have thus far), but I
ALSO want to have the project estimate show up in a text box off to the side.

here are the queries in question:

combo box row source is - "Query for FCR Form"...without quotes..(this
gives me my list of projects)

"Project Estimate" ..without quotes..this query has the project estimates
listed in a field titled Phase 1 and 2 combined

im sure that the textbox has to be linked between these two
queries...correct??

Can someone please help?

Mark



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.