Message boxes again

Robert C

Registered User.
Local time
Today, 09:39
Joined
Mar 27, 2000
Messages
88
First, thanks to Roberts Dunstan and Saye for your replys.

Two more quick questions:-

1. How do I ensure that my message box appears on the form that is being opened. Currently, it appears before the pop-up form I'm opening actally appears on the screen. Ive tried the OnLoad and OnCurrent events but they don't seem to work.

2. Also How can I get a Field Name to appear in the middle of a string of text in the message box?

Thanks again
 
In answer to #1 -- have you tried the before update for your form?

In answer to #2

Type the following code in the OnLoad

Dim strInfo As String

strInfo = Me.FieldName with information you want to put in your MsgBox

MsgBox "Text you wish to display " & strInfo, vbOKOnly, "MsgBox Title"

Please let me know if you have any questions
 
DRananahan

Thanks for your reply. Sorry but I do have another question because I can't seem to get this to work.

Let me give you some more detail:

I have a form - frmOrders - and a subform - sbfOrderDetails. On sbfOrderDetails I have a combo box - cboProductDescription - from which users select a product. There is a NotInList event procedure attached to this combo which opens a pop-up form - frmProducts - so that the new product can be entered. In addtion each product falls into a particular Product Category, which is selected from another combo - cboProductCategory - on the main form.

What I would like is for a message box to appear after this pop-up form has opened which will say - "Don’t' forget to select [The appropriate Product Category to appear here] from the Product Category list."

I hope this is clear - I was hoping I could figure this out for myself, but my knowledge of VB is not too hot.

Thanks again

Rob
 
Fistly, if i understand your problem correctly, I would set the combo box to look up a column in a table as a drop down list. You still select the NotinList option and specify the text to appear if the user does not select from the list.
You can then use some code to ask the user (when they try to enter a new product that is not in the list) if would like to add it to the list. If they say Yes, it is added, and if they cancel, it is not and they have once again to select from the list. You might try the on exit event to say 'if isnull (me.[product]) they msgbox "enter a product" or just use the required option in the table set to yes. if you want the code to ask the user if they wish to update the list which then auto adds it to the table (drop down list) let me know.
 
AndyH

Thanks for the reply. I think the answer to your last question is yes.

All I need is for a message box to appear when the Products form opens which reminds users to select the appropriate Product Category from the combo box. This message must tell them what that category is and this information is in a combo box on the Orders form.

At this stage in the process, they will have already been warned that the Product they are entering is not on the list, and their acceptance of this will have triggered the Products form to open.

I hope this is clear - e-mail me if not.

Thanks again

Rob
 

Users who are viewing this thread

Back
Top Bottom