Prev: Sorting Problem
Next: Using a combo box to open a form
From: m stroup on 16 Feb 2010 11:54 frmSearchType with cboType and cmdOpenForm which opens frmEntryEdit. frmEntryEdit uses cboEntryNum to allow user to select from the filtered records. This is working correctly, however if no records fit the filter, I get an open frmEntryEdit, with no records in the cboEntryNum. I would rather have a message box that states "No Data fits the criteria", than have frmEntry Edit open. Is this possible? -- Teach me to fish! Thanks for the help. Pax, M
From: Marshall Barton on 16 Feb 2010 13:17 m stroup wrote: >frmSearchType with cboType and cmdOpenForm which opens frmEntryEdit. >frmEntryEdit uses cboEntryNum to allow user to select from the filtered >records. >This is working correctly, however if no records fit the filter, I get an >open frmEntryEdit, with no records in the cboEntryNum. I would rather have a >message box that states "No Data fits the criteria", than have frmEntry Edit >open. One way would be to use an If statement with a DLookup to see if there is a match or not. Then you can skip opening the form. Another way would be for the form's Load event to check its RecordCount and Cancel the event if the count is 0. In this case the button's code probably should use error handling to ignore the 2501 error. -- Marsh MVP [MS Access]
|
Pages: 1 Prev: Sorting Problem Next: Using a combo box to open a form |