a search form with a subform
if subform got a record by the search then a cmd button will me visible
how can i do it
a search form with a subform
if subform got a record by the search then a cmd button will me visible
how can i do it
In the event that does the search, something like:
If Not IsNull(Me.subformname!fieldname) Then Me.commandbuttonname.Visible = True
or
Me.commandbuttonname.Visible = Not IsNull(Me.subformname!fieldname)
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
this code is not working
problem
a main unboubd form with a subform(subform is made by a query. query has 5 field, namefield criteria is forms!mainform!textboxname )
a unbound textbox in the main form and a search button.
type a name in the textbox and click the search button
which requery the subform and show the result
What isn't working - the search or setting visibility? What happens - error message, wrong results, nothing?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Private Sub cmdgo_Click()
Me.Qservice_subform.Requery
If Not IsNull(Me.Qservice_subform!Cname) Then
Me.cmdpay.Visible = True
Else
Me.cmdpay.Visible = False
End If
End Sub
visibility is working but the else condition is not working, i want it invisible if the condition is not met
Step debug. What happens when you expect the referenced field is null? Does the False line get executed?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.