Results 1 to 9 of 9
  1. #1
    shinydiamond is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    31

    Datasheet view in Access Web App 2016 - prevent blank record from displayin

    Hello power users,


    I've rolled out a new access web database to a group of mobile users at my company. Things are working well except when some of them use the datasheet view to add a new record. Instead of clicking on the "+" button to add a new record, some users are scrolling to the bottom of the list where a new blank record appears automatically. They will then enter their data into that blank record. The problem with this is that I have a few events set to be triggered when you press the "+" button. If they don't press the + button, these events don't get called and critical information that is supposed to prepopulate into a new record doesn't happen. How do I prevent this blank record from being displayed at the bottom of the datasheet view?

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    set form property AllowAddtions to false on form opening, then to True when they click your button?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    shinydiamond is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    31
    thanks for the reply, Micron. I don't see "AllowAdditions" in any of the macro dropdowns. There is a Set Property function in the drop down, but when I type allowadditions in the control and set value = false, I get an error of unknown command when it runs. Are you sure allowadditions is available in the web app?

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I missed the part where you said you were using macros
    In the macro builder, it appears to be the Data Mode argument of the OpenForm action. However, the settings in my version are Add, Edit (which allows adding) or Read Only. Kinda stupid if you ask me. I can add it to my list of reasons why I don't use macros.
    Your version has macros/events that I don't have. Suggest you explore them (maybe the Data Macro BeforeChange event will take care of your issue). I don't know anything about how you're doing what you're doing, so these are just guesses:
    - use a split form (the datasheet should be locked automatically for you)
    - disable or lock all the datasheet controls yourself
    - use a snapshot type of recordset
    - use table or form level validation so that a record entered this way has to meet your requirements
    Sorry if that doesn't help.
    Edit: I guess I could add 'dispense with the macro' to cover all bases, but that might be the last option since vba is not highly intuitive for most beginners. You could research 'DoCmd.OpenForm event and see what you think about using vba for this one piece of the project.

  5. #5
    shinydiamond is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    31
    Micron,
    Thanks again for the reply. What version are you using? I'm not sure if we're on the same page or not, but with the Access Web App, you Have to use macros with their predetermined options because this runs in a web browser. There is no VBA because malicious code could be used to sabotage your database since you're sharing it with the outside world. I'm a seasoned VBA coder with Access and Excel, but being restricted to these macros is new to me. I'm not sure if you've used the Access web app, but the datasheet view and list view are auto generated when you do so there's not much flexibility except trying to use a macro upon launch of the view. I think I could easily solve this if I was using the desktop version of Access.

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Version info beside my user name (2007). No, I have never built a web db using Access (some experience long ago with MySql and php though). My only info with web apps from Access is that you build them in the desktop version, then publish them to the web. According to https://support.office.com/en-us/art...7-f36b09aa32d2, you need the desktop version to make design changes (at least that's how I interpreted the content). Also, this page https://msdn.microsoft.com/en-us/lib.../jj249305.aspx leads me to believe you can use a web app macro to run UI macros, so I based my last answer on those pages, which admittedly, I have no real experience with. Hope it wasn't misleading and that those pages will help.

  7. #7
    shinydiamond is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    31
    Thanks, Micron. I did build it the way you're describing and am using the UI macros which are limited and a bit clunky. I actually have an 800 page book on Access web app design and programming but it doesn't cover this issue. Hopefully someone else out there has come across this and solved it. Also, it would be nice if there was a separate part of this forum dedicated to Web App design/programming to keep that info separate.

  8. #8
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Last ditch effort on my part. Here https://msdn.microsoft.com/en-us/lib.../dn180198.aspx it looks like either the Data Actions, Data Entry or Program Flow macro actions might provide some possibilities, albeit clunky ones. The trick might be that one needs a way to trap for a certain condition. Wish I could explore this more.
    Your idea of a forum section for the subject sounds interesting. Good luck!

  9. #9
    shinydiamond is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Mar 2016
    Posts
    31
    thanks, those links are basically just showing the drop down options that are available in the macro builder. I have used most of these for other purposes in my database. Unfortunately, there's nothing there that can prevent a new blank record from displaying. Anyone else have this issue and solved it?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Prevent automatic creation of blank record on form open.
    By IncidentalProgrammer in forum Forms
    Replies: 2
    Last Post: 03-12-2015, 06:54 AM
  2. Replies: 2
    Last Post: 12-12-2013, 02:13 PM
  3. Replies: 3
    Last Post: 08-18-2013, 09:14 PM
  4. Replies: 6
    Last Post: 11-21-2012, 05:10 PM
  5. Selecting a Record in Datasheet view
    By JFo in forum Access
    Replies: 3
    Last Post: 11-01-2011, 10:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums