Re: Data1.Recordset.AddNew
It would be easy enough using programming code, but I don't know of a way using a bound data control.
Re: Data1.Recordset.AddNew
how do i use programming code, as you suggested, could you teach me?
Re: Data1.Recordset.AddNew
Re: Data1.Recordset.AddNew
Once you are comfortable in connecting via code, we can take a look as using the SQL SELECT query to return a value from your database.
Re: Data1.Recordset.AddNew
hi
i went through the tutorial.... could you show me on the sql part?
thanks
Re: Data1.Recordset.AddNew
Re: Data1.Recordset.AddNew
hello
thanks for the sql tutorial, i managed on the below codes:
Set DB = OpenDatabase(App.Path & "\Project Light Speed.mdb")
SQL = "select * from [Taper_Code] where Taper_Code ='" & txttaper.Text & "'"
Set rs = DB.OpenRecordset(SQL)
SQL = "insert into Taper_Code (Taper_Code) " & _
"values ('" & txttaper.Text & "')"
DB.Execute SQL
How do i implement that after i select the record, if not found then do the insert part, else display a message box?
please help
Re: Data1.Recordset.AddNew
Code:
Set DB = OpenDatabase(App.Path & "\Project Light Speed.mdb")
SQL = "select * from [Taper_Code] where Taper_Code ='" & txttaper.Text & "'"
Set rs = DB.OpenRecordset(SQL)
If rs.RecordCount = 0 Then 'it does not exist
SQL = "insert into Taper_Code (Taper_Code) " & _
"values ('" & txttaper.Text & "')"
DB.Execute SQL
Else
MsgBox txttaper.text & " already exists in the database."
End If
Re: Data1.Recordset.AddNew
hack,
Thank you so much for your help, that code works great.
joyce