Results 1 to 4 of 4

Thread: [RESOLVED] MS Access (DAO: How to MSGBOX contents of a table with a button

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    15

    Resolved [RESOLVED] MS Access (DAO: How to MSGBOX contents of a table with a button

    This may seem a very simple question, but I really don't know how to do it. Basically, I want to MessageBox contents of a table with a button. I have a table called Map, and has two fiels: Column Number and Description. When a button is pressed, then I want a messagebox to come up and show the column number and the description of a single field. Although I know it is very wrong, here is the code I used for this (r![column Number] = 4 is meant to be the forth column number in the table):

    Dim d As Database
    Set d = CurrentDb
    Dim r As Recordset
    Set r = d.OpenRecordset("Map")


    r![column Number] = 4
    MsgBox "Column No: " & r![column Number] & ". Description: " & (r![Description])

    By the way, there are seperate buttons for seperate fields
    Thanx in advance

  2. #2

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    15

    Unhappy Re: MS Access (DAO: How to MSGBOX contents of a table with a button

    Common guys, please. I need to do this as soon as possible.
    Pleeeeeeeeeeeeeeeeeeeeeeeease!!!

  3. #3
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: MS Access (DAO: How to MSGBOX contents of a table with a button

    How can you show Column Number and Description for a single field? You state that they are two fields. Do you mean a single record? If that's the case, open a query
    Code:
    "SELECT [Map].[Column Number], [Map].[Description FROM [Map]
    WHERE [Map].[Column Number] = 4"
    There are several other issues. One, I think all your names - Map, Column Number and Description may be reserved words. You shouldn't use reserved words for names. Two, I'm not sure if by Column Number you mean you have a field named Column Number, or you want the 4th field in the table. You say you only have two fields. Maybe you mean row, which would be a record?
    Please clarify.
    Tengo mas preguntas que contestas

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    15

    Re: MS Access (DAO: How to MSGBOX contents of a table with a button

    Thanx for your 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
  •  



Click Here to Expand Forum to Full Width