G
Guest
How can I add records to a table that isn't opened?
John Spencer said:You can use VBA to execute an append query. You can build the append
query string in VBA.
If it is one record based on some values that you know then the SQL might be
StrSQL = "INSERT INTO [TheTable] " & _
"([numberFieldA], [textFieldB], [DateFieldC])" & _
" Values (" & intSomeNumber & _
", """ & strSomeText & """, #" & _
txtSomeDateValue & "#)"
CurrentDB().Execute StrSQL
THat is the best I can do without a lot more detail.
'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
I have a form that is not based on the table that I want to add a record to.
Isn't there a way in VB to open a table, append a record to it, then close
the table?