I have a main form with 1 sub form. When the main form opens the user types in a txt box and when the exit the txt box a search is performed to return any records for that search. The subform is linked on this field. If their is data for the subform then it renders and the user has command buttons to update the data in the subform. However if their is no data to populate the subform it is blank. I have created a command button to launch a pop-up form and the user enters a new record when they save and close the pop-up the form and subform do a requery and display that data. The problem I have is my users continue to use this command button even though the data comes up on their search and they should use the controls in the subform.
What I would like to do is set the default value of the command button for the pop-up to disabled. If the seacrh on the main form for the subform finds no records I would llike to then enable the command button for the pop-up on the main for to be enabled. Then when the user enters the data on the pop-up form and saves and closes, and the main for and subform requeries then disable it again.