|
-
Feb 27th, 2007, 07:14 PM
#1
Thread Starter
New Member
[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
-
Mar 1st, 2007, 05:30 AM
#2
Thread Starter
New Member
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!!!
-
Mar 1st, 2007, 10:41 AM
#3
Frenzied Member
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
-
Mar 1st, 2007, 04:03 PM
#4
Thread Starter
New Member
Re: MS Access (DAO: How to MSGBOX contents of a table with a button
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|