OnCurrent of Form - Make not visible on condition

M

magmike

I currently have the following code under the onCurrent of my form:

Private Sub Form_Current()
Dim strSQL As String
Dim db As DAO.Database


If Me.ID < 0 Then
Set db = DBEngine(0)(0)
strSQL = "INSERT INTO LastVisitedRecord ( lvCompanyID ) " _
& " VALUES ( " & Me.ID & " ) "
db.Execute strSQL
Set db = Nothing
End If
End Sub


However, I'd like to add something to it, but have not had success.
I'd like the form to evaluate if the NOTES field is empty (the NOTES
field is actually on the subform OldNotesSubForm which is not visible
unless the OldNotesLabel is clicked on) and if so, make other controls
and labels not visible. These controls are:


OldNotesLabel
OldNotesBox
OldNotesSubForm


the old notes subform (which contains the NOTES field) is visible =
false until the OldNotesLabel is clicked on.


Thanks in advance for your help!

magmike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top