Unbound text box displaying value from another form.

stevekos07

Registered User.
Local time
, 21:29
Joined
Jul 26, 2015
Messages
174
Let me see if I can put this properly. I have a form which displays information on clients related to a particular "base". In the header of this form I have a calculated field which displays the number of clients who are due to receive a call today, which is obtained from a query:

=DCount("[ClientID]","qryDailyCallSheets","[BaseName] = '" & [cboBaseName] & "' And [CallToday] = 'Yes'")

I want this value to be displayed in another form in an unbound text box. This second form's fields are not derived from the same query. If I try to use the expression builder to derive the value just by an expression:

=[Forms]![frmDailyCallSheets]![txtCalls]

I get an error. Obviously this is not the way to do it.

This second form displays a list of "bases" derived from another query, but using the same table tblBases as it's source information.

I hope this makes sense :o.

Can you shed some light on the easiest way to do this?
 
what is the error, should work if form [frmDailyCallSheets] is already open.
 
I have abandoned this approach now. Instead I have decided a hyperlink from the txtBaseName field to the other form would be better. The other form frmDailyCallSheets has a combobox which is the control for a parameter query that is used to select the base involved. I would like to apply an on-click event to the hyperlink that opens the frmDailyCallSheets form and selects the appropriate base in the combobox.

When I try to do this the parameter dialog box appears with the name of the base in the box description instead of running the parameter query with the value selected.

Can you help with this?
 
replace the parameter in your query with a form reference, example in your sql:

PARAMETERS [Forms]![yourFormName]![ComboName] Text (255);
SELECT field1 FROM table1 WHERE fieldCriteria = [Forms]![yourFormName]![ComboName];

i hope i could explain it better.
 
replace the parameter in your query with a form reference, example in your sql:

PARAMETERS [Forms]![yourFormName]![ComboName] Text (255);
SELECT field1 FROM table1 WHERE fieldCriteria = [Forms]![yourFormName]![ComboName];

i hope i could explain it better.

That would be ok if query was only accessed by the one form. But the query is used in several ways, and cannot be based just on the text box in the form I am referring to here.

I think if I am going to develop this link I will need to design another form based on a modified query as you describe. I don't even need to do that. I could just use a basic query and apply a filter with an onclick event.

I don't think I'll worry. It's not a necessary improvement. I just wanted to make navigation a bit easier, but I don't have time to do the development work needed for a minor improvement.
 

Users who are viewing this thread

Back
Top Bottom