A
Ange Kappas
Hi,
I have already open a Query named ACCOUNTS and I want to copy the
already filtered results into a Table name ACCOUNTS CHARGED.
The code is stuck on the Set Myset=CurrentDb("ACCOUNTS")
What do I have to adjust to make it work?
Thanks
Private Sub ACCOUNTS_CHARGE_Click()
Dim PoseidonHotelProgram As Database
Dim rsta As DAO.Recordset
Dim frm As Form
Dim Msg, Style, Title, Response, MyString
Set Myset = CurrentDb("ACCOUNTS")
Set Myset2 = db1.OpenRecordset("ACCOUNTS CHARGED")
With Myset
If Not .EOF Then
.MoveFirst
End If
Do While Not .EOF
Myset2.AddNew
Myset2![Date] = Myset![Date]
Myset2![RESNO] = Myset![RESNO]
Myset2![RESNAME] = Myset![RESNAME]
Myset2![COMPANY] = Myset![COMPANY]
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![DAILY CHARGE] = Myset![DAILYRATE]
Myset2.Update
..MoveNext
Loop
End With
Myset2.Close
End Sub
I have already open a Query named ACCOUNTS and I want to copy the
already filtered results into a Table name ACCOUNTS CHARGED.
The code is stuck on the Set Myset=CurrentDb("ACCOUNTS")
What do I have to adjust to make it work?
Thanks
Private Sub ACCOUNTS_CHARGE_Click()
Dim PoseidonHotelProgram As Database
Dim rsta As DAO.Recordset
Dim frm As Form
Dim Msg, Style, Title, Response, MyString
Set Myset = CurrentDb("ACCOUNTS")
Set Myset2 = db1.OpenRecordset("ACCOUNTS CHARGED")
With Myset
If Not .EOF Then
.MoveFirst
End If
Do While Not .EOF
Myset2.AddNew
Myset2![Date] = Myset![Date]
Myset2![RESNO] = Myset![RESNO]
Myset2![RESNAME] = Myset![RESNAME]
Myset2![COMPANY] = Myset![COMPANY]
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![DAILY CHARGE] = Myset![DAILYRATE]
Myset2.Update
..MoveNext
Loop
End With
Myset2.Close
End Sub