A
Ange Kappas
Hi All,
Here is another one!
I have a code which copies one record from a query(TODAY CHARGES) to another
table(RESPEL TEST ALL CHARGES).
I want the code to copy all the records in the current query to the table.
Here is the code I have:
Private Sub Toggle1_Click()
Dim PoseidonHotelProgram As Database
Dim rsta As DAO.Recordset
Dim frm As Form
Dim Msg, Style, Title, Response, MyString
DoCmd.
Set db1 = CurrentDb()
Set Myset = db1.OpenRecordset("TODAY CHARGES")
Set Myset2 = db1.OpenRecordset("RESPEL TEST ALL CHARGE")
Myset2.AddNew
Myset2![Date] = Myset![Date]
Myset2![PELNMB] = Myset![PELNMB]
Myset2![RESNAME] = Myset![RESNAME]
Myset2![COMPANY] = Myset![COMPANY]
Myset2![HOTELAPT] = Myset![HOTELAPT]
Myset2![ROOMNO] = Myset![ROOMNO]
Myset2![ROOMTYPE] = Myset![ROOMTYPE]
Myset2![BASIS] = Myset![BASIS]
Myset2![ARRIVAL] = Myset![ARRIVAL]
Myset2![DAYS] = Myset![DAYS]
Myset2![DEPARTURE] = Myset![DEPARTURE]
Myset2![SURNAME] = Myset![SURNAME]
Myset2![NAME] = Myset![NAME]
Myset2![DAILY CHARGE] = Myset![DAILY CHARGE]
Myset2.Update
Myset2.Close
End Sub
What do I have to add to the above to copy all the records.
Help Much Appreciated
Ange
Here is another one!
I have a code which copies one record from a query(TODAY CHARGES) to another
table(RESPEL TEST ALL CHARGES).
I want the code to copy all the records in the current query to the table.
Here is the code I have:
Private Sub Toggle1_Click()
Dim PoseidonHotelProgram As Database
Dim rsta As DAO.Recordset
Dim frm As Form
Dim Msg, Style, Title, Response, MyString
DoCmd.
Set db1 = CurrentDb()
Set Myset = db1.OpenRecordset("TODAY CHARGES")
Set Myset2 = db1.OpenRecordset("RESPEL TEST ALL CHARGE")
Myset2.AddNew
Myset2![Date] = Myset![Date]
Myset2![PELNMB] = Myset![PELNMB]
Myset2![RESNAME] = Myset![RESNAME]
Myset2![COMPANY] = Myset![COMPANY]
Myset2![HOTELAPT] = Myset![HOTELAPT]
Myset2![ROOMNO] = Myset![ROOMNO]
Myset2![ROOMTYPE] = Myset![ROOMTYPE]
Myset2![BASIS] = Myset![BASIS]
Myset2![ARRIVAL] = Myset![ARRIVAL]
Myset2![DAYS] = Myset![DAYS]
Myset2![DEPARTURE] = Myset![DEPARTURE]
Myset2![SURNAME] = Myset![SURNAME]
Myset2![NAME] = Myset![NAME]
Myset2![DAILY CHARGE] = Myset![DAILY CHARGE]
Myset2.Update
Myset2.Close
End Sub
What do I have to add to the above to copy all the records.
Help Much Appreciated
Ange