Form Visibility based on set criteria

mad-q

Registered User.
Local time
Today, 22:25
Joined
Feb 14, 2010
Messages
61
I have a subform and some of the users keep typing in it without a master record and thus creating orphans. I really don't want a pop up box. Would there be a way that the subform was invisible if the user hadn't added a record to the master. I was thinking in
if user id is less than 0 form = invisible?

Any thoughts would be so appreciated.

Iain
 
You could do this in the main form's On Current event -

Code:
Me.SubformControlNameHere.Visible = DCount("*", "tableNameHere", "[ChildIDField]=" & Me!IDField)
 
Thank you Bob, this is to try and combat the problem that you posted an answer to the other day. This is how my code stands but I keep getting an error. Please, where am I going wrong?

Me.[Document Details subform].Visible = DCount("*", "Document Details", "[Part Number]=" & Me![User ID])

Main Form = Document Subform
Sub Form = Document Details subform

Once again, my thanks

Iain
 
Is the subform CONTROL (control that houses the actual subform, not the subform itself) really named Document Details subform?
 
No, it is called Document Subform.

Thanks
Iain
 
No, it is called Document Subform.

Thanks
Iain

Then you would need to use this instead:

Me.[Document Subform].Visible = DCount("*", "Document Details", "[Part Number]=" & Me![User ID])
 

Users who are viewing this thread

Back
Top Bottom