I am having trouble creating a code for a button to add a new item,
basically it will save all the data, wipe the form clean but keeping the CustomerID and OrderID the same, and the DescriptionID should go up 1?
Any ideas?
Here's what I have so far which is wrong on many levels. For a start I'm using a "Open Form" thingy, and I cant think of a different way around it.
And when I click on it the entire form is blank!?
Is it a "goto NewRec" source I'm after perhaps? If so how would I maintain the same customerID and OrderID when this happens??
Perhaps it is the NewRec, in which case I suppose it's like any navigation buttons... I will need the option to go backward and forwards also to ammend previous things on the same OrderID... does this make sense?
basically it will save all the data, wipe the form clean but keeping the CustomerID and OrderID the same, and the DescriptionID should go up 1?
Any ideas?
Code:
Private Sub newitem_Click()
DoCmd.RunCommand acCmdSaveRecord
Dim Loc2 As String
Dim Loc3 As String
Loc2 = Me![Wizard step 2 b].Form![CustomerID]
Loc3 = Me![Wizard step 2 b].Form![OrderID]
DoCmd.OpenForm "Wizard step 2 Inv", acNormal, , "[CustomerID]=" & Loc2 & "AND" & "[OrderID]=" & Loc3
End Sub
Here's what I have so far which is wrong on many levels. For a start I'm using a "Open Form" thingy, and I cant think of a different way around it.
And when I click on it the entire form is blank!?
Is it a "goto NewRec" source I'm after perhaps? If so how would I maintain the same customerID and OrderID when this happens??
Perhaps it is the NewRec, in which case I suppose it's like any navigation buttons... I will need the option to go backward and forwards also to ammend previous things on the same OrderID... does this make sense?