I have a program (Main Data database) where there is a due date . How to write a program of a pop up msg to inform user that this order has not delivered by due date.
I have a forms (Partial Delivery Status & Partial Delivery Status subform) please see the both combobox field on the top is not working. why?? can someone help me.
I have a program (Main Data database) where there is a due date . How to write a program of a pop up msg to inform user that this order has not delivered by due date.
I have a forms (Partial Delivery Status & Partial Delivery Status subform) please see the both combobox field on the top is not working. why?? can someone help me.
The reason why your comboboxes will not allow selections is that the form is set to not allow edits, which prevents all changes on the form. You need to change this to 'Enable Edits' to Yes in the form properties.
In regards to your pop-up form, what I have done in the past is put a procedure in a Form Load event which searches for the offending records, then loads the form with the required information or msgbox etc. You could use a loop to search the entire recordset.
In regards to your pop-up form, what I have done in the past is put a procedure in a Form Load event which searches for the offending records, then loads the form with the required information or msgbox etc. You could use a loop to search the entire recordset.
I have attached a copy of your database with an example pop-up form. Here are just a few points which may help you understand the code a little better;
In the Product MasterList Form
Code:
Private Sub Form_Load()
On Error GoTo 10
DoCmd.OpenForm "Partial Delivery Status subform", acNormal, , , , acHidden
Dim reccount As Integer
reccount = Forms![Partial Delivery Status subform].Recordset.recordcount
If reccount > 0 Then
DoCmd.OpenForm "frmPopUp", acNormal, , , , acDialog
End If
DoCmd.Close acForm, "Partial Delivery Status subform"
10 Exit Sub
End Sub
Firstly, the Form_Load event is what the form executes on opening, so whatever code is in this event will be done before even displaying the form itself.
The first DoCmd (Do Command) function opens the form as hidden, as you don’t want the users to see any of this action.
The reccount declaration counts the number of records within the subform which is used for your partial delivery form (based on the relavant query).
After this, I have said that if the records are greater than 0 then open the pop-up form, else close the original Partial Delivery Status subform.
I hope I haven’t insulted your intelligence by giving you this information, there are also probably multiple ways of executing the pop-up action, however, for ease of understanding, I find this one quite effective.
Also, if I may, a few suggestions on your database;
• Have a Navigational form which allows users to navigate to other areas by the simple click of a button
• Validate your saving ability within new records, as you are able to save entries which are missing other information
• Place a close button on your forms to close down the form or application
• When you have subforms displayed remember to set the Lock property if you do not want the user to alter this.
• The flashing PC Search is a good use of coding, however, it can appear a little annoying after about a minute, I placed an If statement within the Timer method, so that it stops flashing after 20 times (double the amount in the if statement to get the desired flashes as each time it accesses the method both on and off it counts 1).
You may have already thought of these things, or the database may be in its early stages of development. Anyhow, good luck and I hope this helps
Cheers & Beers
Rat.