G
gatarossi
Dear all,
I'm trying to update some information in ms access from a useform in
ms excel. My problem is that I don't known how to do for the vba code
understand the values in my form...
This is the code:
Sub update_tax()
Dim wrkSpace As DAO.Workspace
Dim db As DAO.Database
Dim qryDef As DAO.QueryDef
Dim qryNome As String
Dim strSQL As String
Dim strDB As String
On Error Resume Next
strDB = ThisWorkbook.Path & "\bd.mdb"
Set wrkSpace = Workspaces(0)
Set db = wrkSpace.OpenDatabase(strDB)
qryNome = "qryUpdate_Tax"
db.QueryDefs.Delete qryNome
strSQL = "UPDATE taxa SET tax.tx_dolar = '" & txtTax & "' "
strSQL = strSQL & "WHERE (((tax.period)= '" & txtPeriod & "')) ;"
Set qryDef = db.CreateQueryDef(qryNome, strSQL)
qryDef.Execute
End Sub
Thanks in advance!!!
André.
I'm trying to update some information in ms access from a useform in
ms excel. My problem is that I don't known how to do for the vba code
understand the values in my form...
This is the code:
Sub update_tax()
Dim wrkSpace As DAO.Workspace
Dim db As DAO.Database
Dim qryDef As DAO.QueryDef
Dim qryNome As String
Dim strSQL As String
Dim strDB As String
On Error Resume Next
strDB = ThisWorkbook.Path & "\bd.mdb"
Set wrkSpace = Workspaces(0)
Set db = wrkSpace.OpenDatabase(strDB)
qryNome = "qryUpdate_Tax"
db.QueryDefs.Delete qryNome
strSQL = "UPDATE taxa SET tax.tx_dolar = '" & txtTax & "' "
strSQL = strSQL & "WHERE (((tax.period)= '" & txtPeriod & "')) ;"
Set qryDef = db.CreateQueryDef(qryNome, strSQL)
qryDef.Execute
End Sub
Thanks in advance!!!
André.