data access page, open with blank record without killing =date()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • munkee
    Contributor
    • Feb 2010
    • 374

    data access page, open with blank record without killing =date()

    Is there a way to automatically have a web based data access page to start on a new record when you open the page? (Without going to data entry mode in page properties) If I go to data entry mode, then certain things don't work correctly (for instance having a default value for date and time as date() and time() or having a default value in any field for that matter)

    I want the person entering data to have a clear form so they don't overwrite existing information, but I also need to auto date and time stamp each record. Thanks in advance for your help.
  • beacon
    Contributor
    • Aug 2007
    • 579

    #2
    Originally posted by munkee
    Is there a way to automatically have a web based data access page to start on a new record when you open the page? (Without going to data entry mode in page properties) If I go to data entry mode, then certain things don't work correctly (for instance having a default value for date and time as date() and time() or having a default value in any field for that matter)

    I want the person entering data to have a clear form so they don't overwrite existing information, but I also need to auto date and time stamp each record. Thanks in advance for your help.
    Hi munkee,

    I created a Data Access Page (DAP) a couple of years ago and had a lot of issues getting teh pages to work the way I wanted them to. However, I was persistent and somehow managed to get it to work.

    While I can't pinpoint the exact reason why your DAP is acting strangely for you, here are a few things to check:
    1. If you right-click on your DAP and choose Properties, do you have DataEntry set to True?
    2. While still looking at your DAP's Properties, do you have dscUpdateableSn apshot as the RecordSetType?
    3. Are you using the built-in Navigation container for your records? If not, you may have to in order to get it to work properly, otherwise the DAP may think that you want to go to the first record each time.
    4. Do you have an AfterUpdate() event in your VBScript for the page?


    Here's my AfterUpdate() event from my DAP for you to check out. Perhaps, when combined with the Navigation container, it will help determine the correct record. *Note the "abc" in parenthesis after the AfterUpdate event...somewhe re I read that you have to put something in as an argument in order for them to work properly, so that's something to consider if you've already got an AfterUpdate event. It's also worth mentioning that I actually wrote code to clear or reset a number of fields on my DAP when the record saves if they were dependent on a checkbox being checked or a radio button being selected:
    Code:
    <SCRIPT language=vbscript event=AfterUpdate(abc) for=MSODSC>
    <!--
    
    	ProblemType.Disabled = True     'Disable the field when the record saves
            ProblemType.Value = " "         'Set the value of the field to Null
            ProblemType_Label.Style.Color = "Black"     'Change the label color from red back to black
    
    	
    	msgbox "Your record has been saved." + chr(13) + chr(13) + "Press OK to enter another call.", vbOKOnly + vbInformation + vbApplicationModal, "Record Saved"
    		
    -->
    </SCRIPT>
    Hope this helps,
    beacon

    Comment

    • munkee
      Contributor
      • Feb 2010
      • 374

      #3
      Thanks for the reply beacon. This is my first time working with a DAP and I havent used access in some years I will give the code a try at work tomorrow.

      Another issue I have is that if a user bails out of filling in the form I'm finding that parts are saved to the table (as I would expect within a normal access form). Is there a way of ensuring that no data is saved to the DB until the save button is actually clicked?

      Also out of interest, does anyone have good resources for DAP info? It is by pure luck that my current company are using access 2003 with a DAP seeming perfect for the current project i'm working on, otherwise I would have been a bit stuck trying to figure a work around with infopath. However due to the newer versions of access I cant seem to find any good info about these pages.

      Comment

      • beacon
        Contributor
        • Aug 2007
        • 579

        #4
        Are your fields on your table, that your DAP is based on, setup with the required property set to yes?

        That's the way I've got mine setup...all the fields on my tables that are included in my DAP are required, so if a person doesn't enter a value they get an error message. If they completely close the form, any data entered into the form shouldn't save to the table.

        There aren't a lot of good resources for DAPs, especially now that the option has been deprecated. I'm not sure if you company would be willing or not, but you may want to consider upgrading to Access 2007 or 2010 because I think it has the capability to create HTML based web pages that are much easier to work with.

        That being said, here are a couple of sites that I bookmarked when I was working with on my DAP a couple of years ago:





        Comment

        • beacon
          Contributor
          • Aug 2007
          • 579

          #5
          By the way, I forgot to mention that I use the LogNavNew button in my navigation bar instead of the LogNavSave button. I don't remember exactly why I did this, but I seem to vaguely recall something about how nothing would save until you hit the LogNavNew button, and would throw an error until it was pressed.

          Just for aesthics, I changed the picture for LogNavNew to the picture for the LogNavSave (the disk with a pencil) because it made more sense to my users.

          Comment

          • munkee
            Contributor
            • Feb 2010
            • 374

            #6
            Thanks for all the info beacon. I decided the headache was begginging to get too much so chose go in a slightly different direction with my initial plan.

            I have hidden the textbox which required the =date() and which is now appended to the box when the user submits the form, just before the save record event. I will take a look at the resources you have listed. I think I'm stuck to using DAPs for now, 2007/2010 version may come but there are about 400k employees using the current version without manhy issues.


            --- Edit:

            I also use the New and replaced the save, it makes more sense for a user to be able to see the data "vanish" and kind of makes them think it is going somewhere when the save button really doesnt do anything apparent to them.

            Comment

            • beacon
              Contributor
              • Aug 2007
              • 579

              #7
              Originally posted by munkee
              Thanks for all the info beacon. I decided the headache was begginging to get too much so chose go in a slightly different direction with my initial plan.

              I have hidden the textbox which required the =date() and which is now appended to the box when the user submits the form, just before the save record event. I will take a look at the resources you have listed. I think I'm stuck to using DAPs for now, 2007/2010 version may come but there are about 400k employees using the current version without manhy issues.


              --- Edit:

              I also use the New and replaced the save, it makes more sense for a user to be able to see the data "vanish" and kind of makes them think it is going somewhere when the save button really doesnt do anything apparent to them.
              Sounds like you're in the same boat I am in regards to the version of Office you're having to use. I've got faith that you'll find a way to make it work.

              Comment

              Working...