Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set a default in a field in an AccpacViewList

Status
Not open for further replies.

LESHEL

Programmer
Jan 11, 2012
11
US
Hello,
I am trying to set a field in an AccpacViewList to a default value. Specifically, I am trying to set the location value to "Store" in the viewlist on the Inventory Receipts screen. I tried to set it in the DS onRecordChanging event but it doesn't seem to commit the value until after the viewlist validates the field.

Private Sub dsICREED_OnRecordChanging(ByVal eReason As AccpacCOMAPI.tagEventReason, pStatus As AccpacCOMAPI.tagEventStatus, ByVal pField As AccpacDataSrc.IAccpacDSField, ByVal pMultipleFields As AccpacDataSrc.IAccpacDSFields)

If eReason = RSN_ADDNEW Or eReason = RSN_UPDATE Or eReason = RSN_FETCH Then

If vlsICREED.GetActiveColumn = 0 Then
dsICREED.Fields("LOCATION").Value = "STORE"
'vlsICREED.ColumnIndexByField ("LOCATION")
vlsICREED.UpdateCurrentRecord (2)
vlsICREED.SaveRecord
End If

End If
End Sub
I also tried to change it in a few Viewlist events but they don't seem to be the right ones or I am not using them right.

Any ideas would be so greatly appreciated!

Thanks!
LeShel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top