how to create a query to handle "No Such Data Found"

  • Thread starter Thread starter Fuzuy
  • Start date Start date
F

Fuzuy

I try to create an interface to display records/ or posting message on
a form when I select data from a table which meet the combo box
values to diaplay on a form, however, sometime data of combination of
two combo boxes are not exist..

how should I do so that when it has data it displays the data on a
Form, while no criteria meets then it posts a message "No Such Data
Found" and be also direct back to combo boxes menu.

Thanks in advance for your help..
 
I try to create an interface to display records/ or posting message on
a form when I select data from a table which meet the combo box
values to diaplay on a form, however, sometime data of combination of
two combo boxes are not exist..

how should I do so that when it has data it displays the data on a
Form, while no criteria meets then it posts a message "No Such Data
Found" and be also direct back to combo boxes menu.

Thanks in advance for your help..

The form that displays the data is the form with the combo box?
Code the form's Load event:

If Me.RecordsetClone.RecordCount = 0 then
MsgBox "No Records Found"
Me.ComboName.SetFocus
End If
 
Fuzuy said:
I try to create an interface to display records/ or posting message on
a form when I select data from a table which meet the combo box
values to diaplay on a form, however, sometime data of combination of
two combo boxes are not exist..

how should I do so that when it has data it displays the data on a
Form, while no criteria meets then it posts a message "No Such Data
Found" and be also direct back to combo boxes menu.

Thanks in advance for your help..

Before applying the combo box selections to your form's Record Source, you
could execute a query that checks to see if there are any records that
match. This could be done in the combo box's AfterUpdate event. If there are
no records, show a Messagebox and return to the combo box. If there are
records, apply the selection and load your form's records.

Carl Rapson
 
Back
Top