Question : Message Box in access to display table cell value

Hi
I have a problem. I am unable to get this type of message box to work. I am attaching a access file where I made a table that is updated by a update query. And whenever the query updates the table, it also stores the time (when the update was done) into that table. Now I want to do a message box that could display the table1.DateUpdated cell value(that has the update date) in the messagebox, then the users could think whether to do update or not based upon the recent
date of last update.

' I want to do something like Something like this-->:
'Last Update was table1.[log1.DateUpdated], Do you still want to update? I am also attaching a picture of that type of msgbox. Please help.

Answer : Message Box in access to display table cell value

Ooops, had to make a couple changes to work with your example. Run [TestUpdater] to see in action.

Amended example db attached also.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Sub TestUpdater()
  ShowLastUpdate "log1"
End Sub
 
Public Sub ShowLastUpdate(logID As String)
  If MsgBox("Last update was on " & DMax("DateUpdated", "Table1", "ID = '" & logID & "'") & "." & Chr(10) & _
  "Do you want to update now?", vbYesNo) = vbYes Then
    'Continue with update
  End If
End Sub
 
example
 
Random Solutions  
 
programming4us programming4us