Posted by: Craig Hatmaker
database, development, excel, Microsoft Excel, ms query, odbc, sql, tutorial, vba
When the user changes something and
When they want to post entries to the database (aka add, change or delete data).
Today’s post covers the second situation. The second situation requires a “Post” button. We give the user a “Post” button with this command:
Create_Easy_Button “Post”, “Sheet1.Post_Click”, 105, 10
Copy the code below to your “Data” worksheet
Use Alt-F8 to bring up the Macros’ list.
Note the Sheet# name infront of Post_Click. That’s the Macro name you’ll need.
‘ Wrapper for Post and Load_Data_Logs tied to “Update Logs” button
‘ Date Init Modification
‘ 05/22/09 CWH Initial Programming
On Error Resume Next
Settings “Disable” ‘Disable events, screen updates & Calc.s
Dim bResult As Boolean
bResult = Post(sConnect, _
“”, sFields, _
“”, sData, _
If bResult = Success Then _
Load_Data False ‘False means no prompting
Settings “Clear” ‘Enable events
On Error GoTo 0