show a Query value in a form

  • Thread starter Thread starter Willy
  • Start date Start date
W

Willy

I am attemptiing to show a query value in a form but am unable to get it to
display? I have a formula running in a query, based on information inputted
by operators in a form. But they need to see the formula based on the data
entry directly after entry. I placed a field in the form but am unable to get
it to display the query result.
Also, I need a discussion field to contain more than 255 characters! Access
2007 limits me to 255??? Is there a way around this?
Any help would be great. Thanks
 
Hi

You could requery the specific control on the form and you could change the
text box to format memo field.
 
Thanks Wayne,
The memo field worked perfectly! (da,,, I can't believe I missed that one)
I am not sure how to "re-query" the specific control on the form. (?) Can
you explain further?
Thanks again!!
 
If you are using a single form and you have a text box called
TextBox123 and you want another control to be "updated" (requeried)
in this case I will call it TextBoxABC then you would put a small
bit of code on the ASfterUpdate event of TextBox123
Like this

Private Sub TextBox123_AfterUpdate()
Me.TextBoxABC.Requery
End Sub

Not sure what type of form you're using so if this is no good
post back with more details.
 
Hey Wayne,
You are correct in that I am using a single form.
I have a field named: "Q1 Min" (For number of minutes producing a given
product that is 1st quality)
I have another field named: "shift time" (which is the total number of
minutes for the shift)
I then wrote a query to determine the shift efficiency called "Shift
Efficiency". ("Q1 Min" / "shift time") I set this field to be in percent. The
query ran fine and gave me the shift efficiency in percent.
I then attempted to have this vaule appear in the form. However it seems no
matter how I attempt to link this field to the query result it will not come
in.
I would appreciate any thoughts you have.
Willy
 
Just a quick thought. You could base the form on a query and include the
calculation in that query or just do the calculation in the form.

No time at the moment to look at this as I'm really struggling trying to
write the string response codes for a website.

If no one else gives you calculation for the form I will look at it in about
an hour.
 
Hey Wayne,
Sorry to bother you again. I am not sure how to base the form on the query
becasue it is already based on a table. I am not sure if, or how to, make the
form based on both. (?)
I attempted several suggestions on event procedure but could not get it to
run.
I attempted to set the control source on the query result, but it would not
run.
I attempted to set the expression builder several ways, including writing
the formula there based on the fileds in the form and table, but still it
would not run.
This seems so simple!! Two fileds with a simple division! ("Q1 Min" /
"shift time")
I simply need the result to appear in the form.
Any help would be greatly appreciated.

Willy
 
Hi Willy,
open the form in design view.
--open the form's property sheeet
--find the Data tab
--on the left there is a list of data properties
--at top of list is a property called Record Source
--put the cursor in the textbox to the right of Record Source
--click the drop down arrow that appears
--choose the query from the list
--save the form


Jeanette Cunningham
 

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

Back
Top