J
J Arty
Hi all,
re-posting since I wasn't able to find an answer and previous post has some
answers from me with might mislead
pople into think I found the error. So here it is:
I have a form with a subform.... once the user celect the client, he then
goes to the subform and add qty and select a check box to order...
when the user selects the check box the following code is done:
DoCmd.SetWarnings False
Me.OrderID.Value = Forms!OrderParts!OrderID
DoCmd.DoMenuItem acFormBar, acFile, acSaveRecord, , acMenuVer70
'RunCommand acCmdSaveRecord
Call ChangeSQL
Exit Sub
Private Function ChangeSQL()
Dim SupID As Integer
SupID = Forms!OrderParts!SupplierID
Forms!OrderParts!orderpartssubform.Form.RecordSource = "SELECT Orderid,
SupplierID," _
& "ModelID, ProductID, Description, OrderQty, Price, CONVERT(money,
Price * OrderQty) " _
& "AS ExtPrice, Date, Reorder FROM CommandeE" _
& " WHERE (OrderID = N' ' OR OrderID is null OR OrderID = '" _
& Forms!OrderParts!OrderID & "') AND SupplierID = '" _
& SupID & "'"
End Function
but when it gets to the part where i change the recordsource I get this
error : "Run-Time error '2107':
the value you entered doesn't meet the validation rule defined for the field
or control", if I debug and press f5
it run ok.
I am saving the record before I change the record souce... so I should not
get this error, but I am..
I can use the code "'RunCommand acCmdSaveRecord" it tells me the save record
is not available
any help would be greatly appreciated
re-posting since I wasn't able to find an answer and previous post has some
answers from me with might mislead
pople into think I found the error. So here it is:
I have a form with a subform.... once the user celect the client, he then
goes to the subform and add qty and select a check box to order...
when the user selects the check box the following code is done:
DoCmd.SetWarnings False
Me.OrderID.Value = Forms!OrderParts!OrderID
DoCmd.DoMenuItem acFormBar, acFile, acSaveRecord, , acMenuVer70
'RunCommand acCmdSaveRecord
Call ChangeSQL
Exit Sub
Private Function ChangeSQL()
Dim SupID As Integer
SupID = Forms!OrderParts!SupplierID
Forms!OrderParts!orderpartssubform.Form.RecordSource = "SELECT Orderid,
SupplierID," _
& "ModelID, ProductID, Description, OrderQty, Price, CONVERT(money,
Price * OrderQty) " _
& "AS ExtPrice, Date, Reorder FROM CommandeE" _
& " WHERE (OrderID = N' ' OR OrderID is null OR OrderID = '" _
& Forms!OrderParts!OrderID & "') AND SupplierID = '" _
& SupID & "'"
End Function
but when it gets to the part where i change the recordsource I get this
error : "Run-Time error '2107':
the value you entered doesn't meet the validation rule defined for the field
or control", if I debug and press f5
it run ok.
I am saving the record before I change the record souce... so I should not
get this error, but I am..
I can use the code "'RunCommand acCmdSaveRecord" it tells me the save record
is not available
any help would be greatly appreciated