Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show data from a table based on criteria

Status
Not open for further replies.

ali32uk

Technical User
Mar 31, 2011
22
GB
Hi All

I would appreciate some help on the below

I am currently using the below

Private Sub Form_Load()

If Me.Rolling_Year_Change.Value < 0 And Me.YTD_Change.Value > 0 Then
Me.Text147.Value = "The last 12 months are showing a decrease in spend, the YTD spend is increasing"
ElseIf Me.Rolling_Year_Change.Value > 0 And Me.YTD_Change.Value < 0 Then
Me.Text147.Value = "The last 12 months is positive and year to date showing negative growth"
End If

End Sub

This enters text into an unbound text box displaying some guidance notes on the values returned in [Rolling_Year_Change] and [YTD_Change]. I would like to do is rather than have the guidance notes in the code, I would prefer to hold the notes in a table and for the code to pull them from the table to display

Can anyone assist with this?

Thanks

Ali
 
Also, note that with this code in the Form_Load event, the message in Text147, for all Records, will only reflect the Rolling_Year_Change.Value and YTD_Change.Value from the first Record displayed when the Form loads; it will not change with subsequent Records. To do that you'd need to have your code in the Form_Current event.



The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top