Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2003
    Posts
    81

    Unanswered: User data entry into a message box?

    Two questions:

    1. Does access allow for a message box to be displayed which asks for a text string, then upon accepting the text string, place it into a table? Much like a normal text box, just sitting in a popup message box.

    2. If so, how can I go about it?

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Yes it can
    Example

    Dim stil , answer
    Dim backVal as As Boolean
    Dim Tit As String, Question as String
    Stil = vbYesNo + vbQuestion + vbDefaultButton1 ' Buttons
    Tit= "Test asking question using MsgBox"
    Question = "Do you want to continue?"
    answer = MsgBox(Question, Stil, Titel) ' Show message

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Aslo you can check the answer

    If answer = vbYes then
       backVal = True
    else
       backVal = false
    endif

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    Sure......use the InputBox Function. Here is a sample:
    Code:
    Dim Strg As String, a$
    Strg = "This is default"
    Strg = InputBox("Please enter the data I wanna see:", "Enter My Data", Strg)
    If Strg = "" Then
       a$ = "HEY...You gotta enter sumthin!! Try again."
    Else
       a$ = "You supplied:" & vbNewLine & vbNewLine & Strg
    End IF
    MsgBox a$
    OR To simplify the sample:
    Code:
    MsgBox InputBox("Please enter the data I wanna see:", "Enter My Data")

  5. #5
    Join Date
    Mar 2004
    Location
    Cambridge, Ontario
    Posts
    21
    I have a question of my own regarding this issue:
    Could the value that is entered in the input box be stored and used in an SQL statement/query to bring up specific information? (ie: ask for a P.O. number then bring up all info relating to that P.O.)
    Thanks in advance!
    ---
    Phil J.
    Cherry Forest Veneers Ltd.

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Originally posted by spiderweb
    I have a question of my own regarding this issue:
    Could the value that is entered in the input box be stored and used in an SQL statement/query to bring up specific information? (ie: ask for a P.O. number then bring up all info relating to that P.O.)
    Thanks in advance!
    Absolutely. However this may not be the soundest method of passing a number to your query as this would allow your user to type in a number that doesn't exist on your table.
    Last edited by Teddy; 03-25-04 at 10:29.

  7. #7
    Join Date
    Mar 2004
    Location
    Cambridge, Ontario
    Posts
    21
    Thanks for your reply Teddy,
    What would you suggest for this situation? (I apologize for being off topic)
    ---
    Phil J.
    Cherry Forest Veneers Ltd.

  8. #8
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Originally posted by spiderweb
    Thanks for your reply Teddy,
    What would you suggest for this situation? (I apologize for being off topic)
    NP.

    You can do this however you like, it's really a matter of personal preference. My preference in this sort of a situation would be to populate a combo box with all of the possible zip codes, then pass the value of the combobox to the query.

    So the recordsource for the combobox would be like:

    SELECT zipcode FROM yourTable ORDER BY zipcode

    Then you can pass forms!yourForm!ZipCodeComboBox as your parameter.

  9. #9
    Join Date
    Mar 2004
    Location
    Cambridge, Ontario
    Posts
    21
    hmm..
    Somehow I just can't seem to get this to work for me.
    I have a combo box with the following source:

    SELECT [shipped logs].PO
    FROM [shipped logs]
    ORDER BY [shipped logs].PO;

    and then a command button that triggers the following query:

    SELECT [inventory].[species], [inventory].[log number], [inventory].[supplier], [inventory].[length], [inventory].[board feet], [inventory].[total], [inventory].[PO], [inventory].[Date], [inventory].[Destination]
    FROM inventory
    WHERE ([inventory].[PO] Like '*" & [Forms![search PO]![combo0] & "*');

    This likely just a "newbie" mistake on my part, but any further help would be much appreciated. Thanks!
    ---
    Phil J.
    Cherry Forest Veneers Ltd.

  10. #10
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Originally posted by spiderweb

    WHERE ([inventory].[PO] Like '*" & [Forms![search PO]![combo0] & "*');

    This likely just a "newbie" mistake on my part, but any further help would be much appreciated. Thanks!
    Minor syntax problem:

    WHERE ([inventory].[PO] =" & [Forms]![search PO]![combo0] & ")"

Posting Permissions

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