Ali Edwards
Registered User.
- Local time
- Today, 13:31
- Joined
- Apr 19, 2001
- Messages
- 68
I'm struggling with a bit of code here. What I'm trying to do is make an object in a form visible if a certain value in the underlying query exists. So I have the query called "Spare Keys" and the form based on that query. The only field in the "Spare Keys" query is called "Spare Key". So if there is a 'Spare Key' value of "001" in the query I want the "Image1" to be visible in the form. If not then "Image1" should not be visible. Then if there is a value for "002" in the query "Image2" should be visible and so on.
This is what I have done for "Image1" but it doesn't work:
Private Sub Form_Current()
Dim stdocname As String
Dim Stlinkcriteria As String
stdocname = "Spare Keys"
If [Spare Key] = "001" Then
Image1.Visible = True
Else
Image1.Visible = False
End If
End Sub
Can anyone tell me what I'm doing wrong?
Many thanks
This is what I have done for "Image1" but it doesn't work:
Private Sub Form_Current()
Dim stdocname As String
Dim Stlinkcriteria As String
stdocname = "Spare Keys"
If [Spare Key] = "001" Then
Image1.Visible = True
Else
Image1.Visible = False
End If
End Sub
Can anyone tell me what I'm doing wrong?
Many thanks