Hello,
I have a form with various fields. I have it laid out like a chart. Also I want the field to be invisible if there is no value located in the query with that number. Here is my code to help you out.
Everything works fine except that when it loads the fields that have no values are still visible. Any ideas??
cheers
I have a form with various fields. I have it laid out like a chart. Also I want the field to be invisible if there is no value located in the query with that number. Here is my code to help you out.
Code:
sqlPart = "SELECT * FROM tblParts WHERE Area='" & PArea & "' AND [Page]='" & PPage & "'"
Set rsPart = db.OpenRecordset(sqlPart, dbReadOnly)
count = 1
If Not rsPart.EOF And Not rsPart.BOF Then
Do While Not rsPart.EOF
ppart(count) = rsPart("partname")
pcapa(count) = rsPart("Capability")
count = count + 1
rsPart.MoveNext
Loop
End If
Dim cnt
For cnt = 1 To 16
If Not IsNull(ppart(cnt)) Then
Me("pd" & cnt).Value = ppart(cnt)
Me("pd" & cnt).Visible = True
Me("cp" & cnt).Value = pcapa(cnt)
Me("cp" & cnt).Visible = True
Me("nd" & cnt).Visible = True
Me("ad" & cnt).Visible = True
Me("hd" & cnt).Visible = True
End If
Next cnt
rsPart.Close
Everything works fine except that when it loads the fields that have no values are still visible. Any ideas??
cheers