0

hi, im having problem with my current project which is to insert values from variable into fields in access database. i know how to insert values from textbox into access but im having problem using variables.can anyone please help me?

2
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by nuBudDy
0

Hi,

Check This:

dim TextVar As String
Dim NumbVar As Currency
Dim DateVar As Date
Dim sSQL As String
 
sSQL = "Insert Into MyTable(TextField,NumbFld,DateFld) Values ('" & TextVar & "' , " & NumbVar & ", #" & DateVar & "#) "
AConn.Execute sSQL

REgards
Veena

0

veena, thanx for the reply.but i am currently using adodc to connect to the database.my codes are as follow:

'if inserting values from textbox,it will be
Adodc1.Recordset.Fields("Booking_Time").Value = Txt_Time.Text

'i tried using this to insert values from variables into database
Dim time As String
................. 
.................
Adodc1.Recordset.Fields("Booking_Time").Value = time

is there any possible way for me to blend in your codes into the use of adodc?

0

veena. i hv gotten it. it was actually a mistake on the arrangement of codes.thanx so much for your help n concern.really appreciate it.
thanx again :))

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.