2
I’m developing a small application that inserts data into an access database. I am able to enter the data however I wanted to get the last ID value entered (automatic number) for a msgbox.
provider = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
datafile = "C:\Users\RR\Documents\Database2.mdb"
connString = provider & datafile
myConnection.ConnectionString = connString
myConnection.Open()
Dim str As String
str = "Insert into Guias([Remetente],[Destinatário]) Values (?,?)"
Dim cmd As OleDbCommand = New OleDbCommand(str, myConnection)
cmd.Parameters.Add(New OleDbParameter("Remetente", CType(ComboBox1.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Destinatário", CType(ComboBox2.Text, String)))
Only to fix the Tags, the programming is in VBA or VB.NET?
– danieltakeshi