Hi guys
This should be a rather easy question, however my knowledge (and Google) dif not foresee a correct answer.
There is a form (frm_input) with a button 'SaveDocument'
this button executes an append query (works perfect)
after this query is executed, I want to display a messagebox with a result of (another) query
(this is the confirmation for the user that his document is saved, and returns the number assigned to his document)
this is what i have so far:
Private Sub SaveDocument_Click()
DoCmd.OpenQuery ("qry_append_to_tbl_SAP")
MsgBox ("Document .......... saved")
End Sub
The dots should be replaced with the query result (one field only)
this is the SQL for that query
SELECT Max(tbl_SAP.[Doc nr]) AS [MaxOfDoc nr]
FROM tbl_SAP;
how can i paste this query result in the messagebox?
thanks for any kind of help!
This should be a rather easy question, however my knowledge (and Google) dif not foresee a correct answer.
There is a form (frm_input) with a button 'SaveDocument'
this button executes an append query (works perfect)
after this query is executed, I want to display a messagebox with a result of (another) query
(this is the confirmation for the user that his document is saved, and returns the number assigned to his document)
this is what i have so far:
Private Sub SaveDocument_Click()
DoCmd.OpenQuery ("qry_append_to_tbl_SAP")
MsgBox ("Document .......... saved")
End Sub
The dots should be replaced with the query result (one field only)
this is the SQL for that query
SELECT Max(tbl_SAP.[Doc nr]) AS [MaxOfDoc nr]
FROM tbl_SAP;
how can i paste this query result in the messagebox?
thanks for any kind of help!