C
C_skelton
Im using Microsoft Access and need to get my VBA code to insert new data into
a table in my database. The code I have below is what is in my code listings
at the moment;
Private Sub cmdSubmitUser_Click()
Dim stFullname As String
Dim stUsername As String
Dim stPassword As String
Dim stCompanyID As String
Dim stSecLevel As String
Dim mySQL As String 'Access VBA Programming for Dummies
stFullname = "txtUsersFullName"
stUsername = "txtUsername"
stPassword = "txtPassword"
stCompanyID = "combCompanyID"
stSecLevel = "combSecLevel"
mySQL = "INSERT INTO Security (UserName, Password, Security Level, Users
Name, Company_ID)"
mySQL = mySQL + "Values (stUsername, stPassword, stSecLevel, stFullname,
stCompanyID);"
CurrentDb().Execute mySQL
End Sub
The information in my form needs to be taken and inserted into the table.
Any ideas??
a table in my database. The code I have below is what is in my code listings
at the moment;
Private Sub cmdSubmitUser_Click()
Dim stFullname As String
Dim stUsername As String
Dim stPassword As String
Dim stCompanyID As String
Dim stSecLevel As String
Dim mySQL As String 'Access VBA Programming for Dummies
stFullname = "txtUsersFullName"
stUsername = "txtUsername"
stPassword = "txtPassword"
stCompanyID = "combCompanyID"
stSecLevel = "combSecLevel"
mySQL = "INSERT INTO Security (UserName, Password, Security Level, Users
Name, Company_ID)"
mySQL = mySQL + "Values (stUsername, stPassword, stSecLevel, stFullname,
stCompanyID);"
CurrentDb().Execute mySQL
End Sub
The information in my form needs to be taken and inserted into the table.
Any ideas??