I am using DBGRID for entering data in unbound mode. How do I restrict user to a certain number of rows?
You need to keep truck of number of rows and compare it with row limit you set. Something like this Private Sub DBGrid1_UnboundAddData(ByVal RowBuf As MSDBGrid.RowBuffer, NewRowBookmark As Variant) iRows = iRows + 1 If iRows > iLimit Then DBGrid1.AllowAddNew = False End Sub Private Sub DBGrid1_UnboundDeleteRow(Bookmark As Variant) iRows = iRows – 1 If iRows < iLimit Then DBGrid1.AllowAddNew = True End Sub Where iRows - variable that keeps current number of rows and iLimit - variable that keeps maximum number of rows allowed I'm developing reports in VB6 using Data Report and have problems changing the printer setup on the user's machine (he doesn't have permissions to change the page setup properties of the printer) Since he can't change the default from Portrait to Landscape the report won't run - because of "paper size" error. I want to change the properties of the printer just for the duration of the program (like Word does) but can't. I even tried changing it via API - no access to
Related Questions
- The person entering the data for our Company will be different from the person listed in our STEP Agreement. Can we add a user(s)?
- I have a 1-2-3 macro that pauses so the user can enter data into a certain cell. How can I get the same effect in a VBA macro?
- I am using DBGRID for entering data in unbound mode. How do I restrict user to a certain number of rows?