Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Nov 2004
    Posts
    90

    Unanswered: how to present message?

    hello,

    anyone know how to present the message if the textbox or input box is leave as blank? I mean if user dont put data in the textbox then the message presenting user to put more data...any ideas/suggestion please tell me..your help is fully appreciated.

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    In the OnExit event put
    PHP Code:
      Private Sub Text0_Exit(Cancel As Integer)
        If 
    IsNull(Text0Then
           MsgBox 
    "More info"
           
    Cancel 1
        End 
    If
      
    End Sub 

  3. #3
    Join Date
    Nov 2004
    Posts
    90
    thanks a lot 4 ur help hammbakka..Right I just try ur code given to me..the result is ok according to what I need.thanks again.

    And if dont mind, do have any code/ideas to select the data relevant in the table. For example if user type the data incorrect with the record in table. So what I need is the msgbox presenting user to put the data that relevant with the record.If not promt the msg to them. any ideas/suggestion is appreciated.

  4. #4
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    try using a bounded combo box

  5. #5
    Join Date
    Nov 2004
    Posts
    90
    hello,

    based on the previous discussion with 'bud' that give an ideas to do the combobox but the data from table cannot appear in the form..so I choose textbox so that user can enter the data.

  6. #6
    Join Date
    Nov 2004
    Posts
    90
    hello all,

    anyone can show me how to change textbox into combobox? how to make sure it will bound according fieldname that we want it?

    another question is how to set the form present with maximize size. my problem is when I open the form it will present not in maximize size (full screen) then need to double click on it/something else. So any ideas please suggest...your help is appreciated.

  7. #7
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    To maximize a form, use DoCmd.Maximize in the Open event of the form

  8. #8
    Join Date
    Nov 2004
    Posts
    90
    thanks a lot hammbakka,

    anybody knows on how to create combobox that can bound to fieldname in a table?

  9. #9
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    To bound a combo box to a field use:

    Me.yourComboBoxName.RowSource="SELECT yourFiled FROM yourTable"

  10. #10
    Join Date
    Nov 2004
    Posts
    90
    thanks again hammbakka,

    Can I know where to put this code? In what event? lost focus or etc.....any ideas please suggest.

  11. #11
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    According to your application, you can put it at the Open Form, and then put it other else according to your demand. For example you can put it in the get Focus of a TextBox

  12. #12
    Join Date
    Nov 2004
    Posts
    90
    Thanks again,

    I have change my idea to use textbox that I think it better use in my case. So did anyone know how to create msgbox if the data entered is invalid or no in record? please help.

  13. #13
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146
    Quote Originally Posted by oasislah
    Thanks again,

    I have change my idea to use textbox that I think it better use in my case. So did anyone know how to create msgbox if the data entered is invalid or no in record? please help.
    The following code, as it was explained in previous posts, will take of the Null situation. In terms of an "invalid" entry... invalid as compared to what? I might be missing something, but you need some basis for comparison before you can consider data invalid. If you're talking required fields, formatting, and input masks, explore the properties of bound textboxes.

    Code:
    If IsNull(Me.controlname) Then
     MsgBox "Please enter a value for " & [controlname]
    End If

  14. #14
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Quote Originally Posted by smacdonaldnc
    Code:
    If IsNull(Me.controlname) Then
     MsgBox "Please enter a value for " & [controlname]
    End If
    This will show the message and dont stay in the text box

    So, try to use

    Private Sub Text0_Exit(Cancel As Integer)
    If IsNull(Text0) Then
    MsgBox "Please enter a value"
    Cancel = 1
    End If
    End Sub

  15. #15
    Join Date
    Nov 2004
    Posts
    90
    thanks for reply,

    The 'invalid number entered' msgbox is compare to the data that doesn't exist in the database/record. So in my case I have one text box 'Number' in one table trans1 and that Number is refer in one table 'doc_pecah' (field name : document_number). So If the data is not same in 'doc_pecah' (field name : document_number), then msgbox presenting 'The number entered is invalid'.

    any ideas please help...

Posting Permissions

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