J jasmin_m New member Local time Today, 23:53 Joined Jan 10, 2010 Messages 8 Jan 11, 2010 #1 Is there a function to write to practicular field in table. For example wit DLookup function we read particular field from table, is there similar function for writing to field in table.
Is there a function to write to practicular field in table. For example wit DLookup function we read particular field from table, is there similar function for writing to field in table.
D dcb Normally Lost Local time Today, 23:53 Joined Sep 15, 2009 Messages 529 Jan 11, 2010 #2 DoCmd.runsql Db.execute The sql needs to be either "insert into" or "update" If your feeling not not sleeping you can mod records in a recordset.....
DoCmd.runsql Db.execute The sql needs to be either "insert into" or "update" If your feeling not not sleeping you can mod records in a recordset.....
J jasmin_m New member Local time Today, 23:53 Joined Jan 10, 2010 Messages 8 Jan 11, 2010 #3 Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("table") ' if you need to add new record rs.Edit rs!Value= "new" rs.Update rs.Close ....... situation; I have a tabe called "tabel" and two fields in it: "ID" and "Value" And I want with above code to update field "value" for ID =3 .... Why I am geting error on this rs.FindFirst "ID = 3 " rs.Edit rs!Value= "3333333333" rs.Update rs.Close Last edited: Jan 11, 2010
Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("table") ' if you need to add new record rs.Edit rs!Value= "new" rs.Update rs.Close ....... situation; I have a tabe called "tabel" and two fields in it: "ID" and "Value" And I want with above code to update field "value" for ID =3 .... Why I am geting error on this rs.FindFirst "ID = 3 " rs.Edit rs!Value= "3333333333" rs.Update rs.Close
D dcb Normally Lost Local time Today, 23:53 Joined Sep 15, 2009 Messages 529 Jan 11, 2010 #4 rs.Index = "ID" rs.Seek "=", 3 In general, for equivalent types of searches, the Seek method provides better performance than the Find methods. This assumes that table-type Recordset objects alone can satisfy your needs. Why use a recordset?
rs.Index = "ID" rs.Seek "=", 3 In general, for equivalent types of searches, the Seek method provides better performance than the Find methods. This assumes that table-type Recordset objects alone can satisfy your needs. Why use a recordset?
gemma-the-husky Super Moderator Staff member Local time Today, 22:53 Joined Sep 12, 2006 Messages 16,032 Jan 11, 2010 #5 note that seek is not directly available with a linked ytable - eg a normal access backend
D dcb Normally Lost Local time Today, 23:53 Joined Sep 15, 2009 Messages 529 Jan 11, 2010 #6 gemma-the-husky said: note that seek is not directly available with a linked ytable - eg a normal access backend Click to expand... Interesting!Help file says nothing about that ,,,, or my reading is somewhat lacking Can you correct the FindFirst?
gemma-the-husky said: note that seek is not directly available with a linked ytable - eg a normal access backend Click to expand... Interesting!Help file says nothing about that ,,,, or my reading is somewhat lacking Can you correct the FindFirst?
J jasmin_m New member Local time Today, 23:53 Joined Jan 10, 2010 Messages 8 Jan 11, 2010 #7 dcb said: Interesting!Help file says nothing about that ,,,, or my reading is somewhat lacking Can you correct the FindFirst? Click to expand... yea, can someone write this example with findfirst I am searching for a while.... and I also have problem with this also rs.Index = "ID" rs.Seek "=", 4 If rs.NoMatch Then MsgBox "No matches found.", vbInformation, "No records." Else ' error need EDIT how rs!Naziv = "asass" MsgBox rs!Naziv End If rs.Close Last edited: Jan 11, 2010
dcb said: Interesting!Help file says nothing about that ,,,, or my reading is somewhat lacking Can you correct the FindFirst? Click to expand... yea, can someone write this example with findfirst I am searching for a while.... and I also have problem with this also rs.Index = "ID" rs.Seek "=", 4 If rs.NoMatch Then MsgBox "No matches found.", vbInformation, "No records." Else ' error need EDIT how rs!Naziv = "asass" MsgBox rs!Naziv End If rs.Close
D dcb Normally Lost Local time Today, 23:53 Joined Sep 15, 2009 Messages 529 Jan 11, 2010 #8 This part of your code was fine: rs.Edit rs!Value= "new" rs.Update rs.Close
D dcb Normally Lost Local time Today, 23:53 Joined Sep 15, 2009 Messages 529 Jan 11, 2010 #9 To locate a record in a table-type Recordset, use the Seek method Had to read the help file again it seems: If you change "table" to "Select * from table" it should work I keep meaning to say: "Value" is a reserved word - don't use it as a column name Last edited: Jan 12, 2010
To locate a record in a table-type Recordset, use the Seek method Had to read the help file again it seems: If you change "table" to "Select * from table" it should work I keep meaning to say: "Value" is a reserved word - don't use it as a column name