Create a pop-up Message box to display results?

RitaMoloney

Registered User.
Local time
Today, 12:27
Joined
May 6, 2004
Messages
50
Hi,

I really need some help with this as I am a novice at vb.
I have a table called tblStores which contains the fields PartName, UnitsInStock, ReorderLevel and Discontinued. I have created a form called frmStoreRoom, this form displays the PartNames details upon selecting a part name via a combo box. All is working well here.

I need to check through all records in tblStore to find the PartNames where the UnitsInStock is less than or equal to ReorderLevel and that are not Discontinued. If there are any Parts, I would like the results to be displayed in a message box that will pop-up when the frmStoreRoom form is opened.

The message box could display the names of each part that needs tobe reordered and ask the question would you like to reorder or cancel. These would be two buttons where the reorder button would take you to the reorder form. The cancel button would ignore everything and close the form/message box.
I know I can create a form to be used as the message box but I have no idea how to go about doing the vb side of it. If anyone has any suggestion it would be great.

Thanks in advance,
 
Hi

As far as I can see you are happy to create the form you want to show the parts that need reordering, but don't know how to get the form to open automatically.

If this is the case, put an event procedure on the on open event of the frmstoreroom form to open your message box.

You can determine the code needed for this by putting a button to open the message form onto your frmstoreroom, copying the relavent bit of code into the on open event, then deleting the button.

Hope this helps

Sue
 
Hi,

Thank you for your suggestion but before I get the message box to open automatically I need to be able to check through the tblStores and find the PartNames to be reordered. Not sure how this goes, but something like this,

If(UnitsInStock <= ReorderLevel And are not Discontinued)
Then show message box (with the names of the parts to be reordered)
Or else don't show messagebox.

Something like this (I think) should be in the on open event of the frmStoreRoom. Would I also need some code in the message form to show each of the PartNames?
I don't know how to go about doing this. I would really appriciate it if someone could suggest something or point me to some file.

Thanks,
 
Is your "Discontinued" field a CheckBox?
 
___ said:
Is your "Discontinued" field a CheckBox?

Yes, the "Discontinued" field is a CheckBox. Sorry, I forgot to mention that!!

Thanks for your responce.
 
Here's a simple way, open frmStoreRoom.

HTH
 

Attachments

Last edited:
Hi,

I just want to say thank you all for your responses. Especially for the person that send the zipped file. I copied your code and it is now working perfectly in my database. Thank you again for your time and effort I really appreciate it, I probable would never have got it working without your help.
 

Users who are viewing this thread

Back
Top Bottom