Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2004
    Posts
    90

    Unanswered: how to create msgbox?

    hello,

    Can anyone help me on how to prompt message box? my problem is when user key in data inside textbox that excluded data from the table then a message will show to users about it..I have try many time but there are message with invalid qualifier...someone please help....

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    To call the message box Function
    Dim back as Variant
    back = MsgBox (" YourMessage", vbOKOnly + vbInformation, "Titel of the Message")

  3. #3
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by oasislah
    hello,

    Can anyone help me on how to prompt message box? my problem is when user key in data inside textbox that excluded data from the table then a message will show to users about it..I have try many time but there are message with invalid qualifier...someone please help....
    Hi again oasislah,

    Just slow it down a bit and explain it again, in very easy detail. I'm not quite understanding your situation. When someone types Something in a TextBox you want it to display a MessageBox? Why are they getting this message box? What are the Conditions for the message?? i.e. to let them know they input the wrong data? To Thank Them for inputting anything at all? To tell them what they need to do next?? Just what are the reasons for the MessageBox to pop up on the user after entering data into the TextBox? IF, the user should be inputting ONLY certain SPECIFIC data in the TextBox, why not make it a ComboBox and then they are Limited to their choices that are acceptable. Following me here????
    Basically though, to make a MessageBox you do this in DesignView of the form:
    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
    'If Screen.PreviousControl.OldValue <> "Total" Then
    'MsgBox "This amount has just been changed.", vbOKOnly, "Changed Quantity"
    'Else
        
        If Total.OnChange <> Total.OldValue Then
        MsgBox "This amount has just been changed.", vbOKOnly, "Changed Quantity"
            
       End If
      
    End Sub
    The above code oasislah is placed in the FormProperties, and the BeforeUpdate event. (could be AfterUpdate as well, depending on situation)
    What it does is, as soon as the value in the "Total" field is changed and you leave that field it pops up the MessageBox...(in the BOLD print above)
    Does this help you out now? Just to make it more clear, to create a MessageBox in code you simply type: MsgBox As soon as you do that, place the double-quotes "and type your message", end with double-quotes, Next use the Comma. As you do that and move on little code snippets (hints) pop up along the way suggesting to you what should be placed next. I know there are other ways to create a MessageBox, but this is just one way that I use. What is in the Italics above is the Conditon/Expression that tells it WHEN TO POP UP THE MESSAGE BOX.

    have a nice day,
    BUD

  4. #4
    Join Date
    Nov 2004
    Posts
    90
    thanks bud,

    I think ur idea to change textbox into combobox is very comfortable for my case.I'm very appreciate it..I have been try to change textbox 'to_warehouse' into combo box but there is no record/list for user to choose the warehouse code..Can u tell me how to set all the record/list of warehouse code.at the properties or where?

  5. #5
    Join Date
    Nov 2004
    Posts
    90
    I have been created/followed the coded that u gave to me but has debug problem. I think I should create the connection between access and vb (afterupdate-event). But I dont know how to link that code with the database (table 'warehouse')....Somebody please help....ur help is really appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •