Show query result in a form (1 Viewer)

thedeadzeds

Registered User.
Local time
Yesterday, 17:40
Joined
Jan 8, 2014
Messages
40
Guys,

Is there a way to link results from a query into a form?

I have a query named "Remaining" and field within that query named "Days Remaining" which is an expression. I would like to see this in a form is possible?

Hope this makes sense?

 

Attachments

  • Capture.PNG
    Capture.PNG
    2.6 KB · Views: 171

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:40
Joined
May 7, 2009
Messages
19,230
add an unbound textbox on your form.
on its record source, put:

=Dlookup("[Days Remaining]", "Remaining")
 

plog

Banishment Pending
Local time
Yesterday, 19:40
Joined
May 11, 2011
Messages
11,643
arnel's method will display 1 value in an input on your form. To show multiple values you will need a sub-form. It would be based on your query and a continous form.
 

thedeadzeds

Registered User.
Local time
Yesterday, 17:40
Joined
Jan 8, 2014
Messages
40
Thank you both, I should have also said that i want the Dlookup result to show based on the whatever name is selected in the drop down in the form called "Name" Is this possible or do i need to provide more info? Sorry, I'm still relatively new to access
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:40
Joined
May 7, 2009
Messages
19,230
just add the combo to your lookup as criteria:

=Dlookup("[Days Remaining]", "Remaining", "[NameField]='" & [Name] & "'")

then on the AfterUpdate Event of you Name combobox, requery the unbound textbox.

Private Sub Name_AfterUpdate()
Me.UnboundTextboxName.Requery
End Sub
 

thedeadzeds

Registered User.
Local time
Yesterday, 17:40
Joined
Jan 8, 2014
Messages
40
Thanks arnelgp, i'm getting an error message in my form. I've attached the database. Any chance you could have a look? Sorry about this
 

Attachments

  • Holiday Database -V3.accdb
    800 KB · Views: 42

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:40
Joined
May 7, 2009
Messages
19,230
check this one please
 

Attachments

  • Holiday Database -V3.accdb
    772 KB · Views: 53

Users who are viewing this thread

Top Bottom