I have two tables in MS Access 2010.
tblStore:
ID ItemID ItemName Out (it's a Yes/No field) 1 A1 ALPHA1 2 A2 ALPHA2 3 A3 ALPHA3 4 A4 ALPHA4 5 B1 BETA1 6 B2 BETA2 7 G1 GIGA1 8 G2 GIGA2
tblOut:
ID ItemID ItemName
I created a form from tblStore in tabular layout and added a command button with vba codes:
`Private Sub cmdSendOut_Click() DoCmd.RunSQL "INSERT INTO tblOut (ItemID, ItemName)" & _ "SELECT ItemID, ItemName FROM tblStore WHERE (Out = True);" DoCmd.RunSQL "DELETE FROM tblStore WHERE (Out = True);" End Sub`
My problem is: after select 2 records in the form and click the [Send Out] button as shown below, system only show 1 record that need to be appended.
Can anybody tell me what went wrong? Thanks!