Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do you pull data from table and display it in msgbox? 1

Status
Not open for further replies.

Dre313

Technical User
Jun 4, 2003
219
0
0
US
I have a button on a form.. which when you click it.. it goes to another form.. but before it goes to the second form.. I want a message box to display a message along with a certain piece of data in a table...

Like say I have 10 items in a table.. I want to display a message to the user.. " You are on item number (" Here would be the "Item No." field [10])" That way the user will be able to know that I am on item number 11.. So when he goes to add data in database... he'll put item number 11 as his next item...


thanks
 
Try something like:

MsgBox "You are on item number " & Me!YourItemNoFieldName & "."
 
I do not think the above reply answers your question. Below I have some example code that tells me how many records there are in a table named tblMember. I am using DAO. So you will have to make a library ink to the DAO library in order for this to work. Simply replace the table name tblMember with your own table. If you are using multiple tables, reply and I will show how to do the same with SQL.

Sub mcrNumberOfRecordsInMemberTable()
Dim db As DAO.Database
Dim tdef As DAO.TableDef


Set db = CurrentDb()
Set tdef = db.TableDefs("tblMember")

'the user should enter the next record using the following
MsgBox "You are on item number: " & tdef.RecordCount + 1

End Sub


God Bless!

Jamie

 
JamieDeVry,

awesome !! it worked... man the forum kicks a$$ hehe

thanks
and have a star

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top