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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List box value stays null Data is displayed on form

Status
Not open for further replies.

jimbo62

Technical User
Oct 19, 2002
43
0
0
US
I have an unbound form (Microsoft Access 2000 ADP/SQL Server 2000) which has a list box containing values from a Views'Single field (only 1 field for Flagging). When the value is Y, I intend to turn OFF an overlayed image on the form. The value in the local window is always "null" no matter what I try. Am I missing something maybe to make the value visible to access.

Here is my code I have tried just about everything and am exhauseted it has to be so simple it will hurt....

Private Sub Form_Activate()

Forms!MainDashboard.List77.SetFocus

If Forms!MainDashboard.List77.Value = "Y" Then

Forms!MainDashboard.Image82.Visible = False

End If

End Sub


Thanks all who reply...
[sadeyes][sadeyes]

Jim

Jimbo[bigsmile]
 
Try to put the code in On current Event then On Activate. The recordset may not be populated at this point

Best of luck
 
This did not work...Anyone have more ideas??

Thanks,

Jimbo[bigsmile]
 
jimbo62,

See if this works, that is taking it you're working on the MainDashboard form currently. Or it is a popup form?:

Private Sub Form_OnCurrent()

Me.MainDashboard.List77.SetFocus

If Me.MainDashboard.List77.Value = "Y" Then

Me.MainDashboard.Image82.Visible = False
Else
Me.MainDashboard.Image82.Visible = True

End If

End Sub

Bud
 
It is an unbound form not set to Pop-Up

Sorry that did not work...

Thanks,

Jimbo[bigsmile]
 
I found the answer to my problem. I was being bull headed and did not want to bind the form to any views. I tried it and referenced the text field.

It Worked!!

To my amazement nothing else was affected by my binding the form to the view.

Does anyone know how this can be done programmatically?

Thanks to all who assisted me in my quest...
[dazed][dazed][dazed][dazed]


Jimbo[bigsmile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top