J
Joe M.
I have a mainform and a subform (named Lookup_results). The subform is bound
to a query. There is a lookup button on the mainform with code DoCmd.Requery
"Lookup_results" followed by Me.Lookup_Results.SetFocus to populate the text
boxes on the subform. I want to have a msgbox appear when the query returns
no data. To do this I put this code in the GotFocus event of the subform: If
Me.RecordsetClone.RecordCount = 0 Then MsgBox.... I have not set focus to any
of the controls on the subform. So far everything works correctly....until I
added another text box to the subform. Now the GotFocus event on the subform
doesn't occur when there's no data. If I remove the newly added text box then
everything works correctly again. Why not? I need to add the textbox to the
subform.
Thanks in advance, Joe M.
to a query. There is a lookup button on the mainform with code DoCmd.Requery
"Lookup_results" followed by Me.Lookup_Results.SetFocus to populate the text
boxes on the subform. I want to have a msgbox appear when the query returns
no data. To do this I put this code in the GotFocus event of the subform: If
Me.RecordsetClone.RecordCount = 0 Then MsgBox.... I have not set focus to any
of the controls on the subform. So far everything works correctly....until I
added another text box to the subform. Now the GotFocus event on the subform
doesn't occur when there's no data. If I remove the newly added text box then
everything works correctly again. Why not? I need to add the textbox to the
subform.
Thanks in advance, Joe M.