Binding label with single value query

gaju_3112

Registered User.
Local time
Today, 20:53
Joined
Nov 4, 2007
Messages
38
I want to bind label control or textbox control with query returning single value. How can I achieve it? My query returns single value.
 
Bound form scenario: Use the On Current event of the form. populate the label.caption
UnBound form scenario: label.caption = dlookup(..,..,..) or use a recordset.
 
Can you describe it in detail. What statement should I use in Current event and what will be the paramemeters for dlookup function?
 
the parameters for dlookup can be found when you press F1!

in the on current event:

label.caption = me.<fieldname>
 
Since I remember how hard it was for me to get my arms around the DLookup syntax (even looking at the help file) I will try to help by being more explicit:

If your query already returns a single value then you don't need the criteria part of the DLookup, so it will be modified to look like this:
Code:
Me.YourLabelNameHere.Caption = DLookup("[YourFieldInYourQuery]", "YourQueryNameHere")
 
Boblarson! It's second time you solved my problem! Very thanx to you!
 

Users who are viewing this thread

Back
Top Bottom