Announcements
What's the preferred approach in VBTools to update a detail level (grid) with the LUpd_DateTime, LUpd_Prog, & LUpd_User info? I tried the sample code below (I found it elsewhere in a search), but it does not seem to update the table (data remains unchanged).
Private Sub Update1_Update(Level As Integer, InsertFlg As Integer, LevelsDone As Integer, LevelsLeft As Integer, retval As Integer)
Select Case Level
Case 0 (header level)
bxtPORqHdr.LUpd_DateTime = bPES.Today
bxtPORqHdr.LUpd_Prog = bPES.ScrnNbr
bxtPORqHdr.LUpd_User = bPES.UserId
Case 1 (grid Level)
bxpmsetup.LUpd_DateTime = bPES.Today
bxpmsetup.LUpd_Prog = bPES.ScrnNbr
bxpmsetup.LUpd_User = bPES.UserId
End Select
End Sub
I've confirmed via Call MessBox() that I'm obtaining the right data, but the table update does not work. No error messages or issues, just no table updates.
Thanks.
*This post is locked for comments
Your post unlocked my brain freeze, and I realized that adding the MUpdate() call to my update event was the missing link!!!! Thanks.
Ah sorry I misunderstood. Then call SUpdate1 on the Level1 Cursor and then call MDisplay on the grid control as well to refresh the grid with the current data.
The SAF_grid control in a detail few makes data access a little more complex. Level0 is getting updated because it's just a single record in the level0 cursor with controls.
If that doesn't work, I have some code I can modify in a test project and share with you.
Jason
Jason, I'm using the VBTools set to build a new screen, not using VBA via Customization Manager. Call SetBufferValue() is valid in VBA and BSL, but is not recognized as a valid function in VBT. Strange thing is, when I use the sample code on LEVEL0, the table gets updated, but not on the LEVEL1 (grid).
Assuming those fields are in the cursor but not actually bound to controls in the grid, I believe you have to use SetBufferValue() to update them. Direct access only works if the fields are bound to controls in the grid.
The SetBufferValue() page in the Visual basic for applications help file on your client has a good explanation of this.
If it is on the grid try using SetObjectValue().
André Arnaud de Cal...
294,120
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator