Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2009
    Posts
    7

    Unhappy I want my form to open blank


    I am using Access 2000. I am trying to get my form to open up blank. So that when a user prepares to enter information in the blanks there is no data already in the fields. I am familar with access, but have no idea about this VB coding stuff. So if you have the time and decide to answer my question I would need to know step-by-step how to incorporate anything that requires code to make this work. I don't understand ANY VB AT ALL!!!! Yeah, I'm pitiful. The 1st step is admittance. The 2nd step is YOU helping me. I'm about to lose my mind..........

  2. #2
    rommelgenlight is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    77
    we can help you out here, but the best advice I can give you is to study the sample database included there in your ms office installer. most of the basics are found on those samples. you will learn much faster that way.

  3. #3
    SteveAb is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    4

    Follow Up

    I now have the same question. did you ever find a way to open your form without any records showing?
    Steve

  4. #4
    Simple is offline Novice
    Windows XP Access 2000
    Join Date
    Nov 2009
    Posts
    8
    There is a bunch of ways to do this. You can create your form off a mirror table that never actually holds the data your entering. You can filter the form with a query. You can filter the form in vba with docmd.openform.

    The easiest is to just build a query to use as a filter where in one of the fields in the table ( I assume theres at least one) that won't ever be blank is set to where is null as the criteria. NO CODING REQUIRED.

    If you build a mirror of your actual table with no data and build your form off that then the record will always be blank. Then you'll need a button to save who's on click event will call a query that appends the form data to your actual table, and one to close without saving to prevent the blank table from getting any data. This is actually fairly easy too. MINIMAL CODING REQUIRED

    If you use the docmd.openform it will be the same as the filter query just in vba. If you google it you'll find plenty of info on how to do it.

    Personally I use the second option (sorta, more vba in it but same idea). My end users are knucklheads so I have to make sure I get complete data or no data at all.

    Romm is right though, I've mostly been a query guy up until the past few months, so what I've posted above was learned through examples, trial / error, and some pointed questions.

  5. #5
    SteveAb is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    4
    Simple,
    I appreciate your response. Since I am a beginner I will need to experiment with your suggestions a bit and figure out what building a mirror entails but you have given me a starting point. Thanks for the help.
    Steve

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If the DataEntry property of the Form (on the data tab) is set to YES, the form *only* shows new records.

  7. #7
    Simple is offline Novice
    Windows XP Access 2000
    Join Date
    Nov 2009
    Posts
    8
    No sweat. By mirror I just me copy. Just a blank (no data) of the original. Build your form on that one. Once you have the form made on that table create two buttons. While in design view open the properties of that button and go to the events tab, find the on click, click on that field then click the "..." to the right and select code builder. Paste

    Private Sub {Your Button} Onclick ()
    'You don't need the above it is already there.
    me.undo
    DoCmd.Close
    'You don't need the below it is already there.
    End Sub

    That will prevent the data from saving.

    Now go create a query on any table since we won't actually be using any field form the table.

    Go to where you'd drop in a field to query, right click and select build. For each field you want from your form type = then look below and you'll see some folder, dbl click forms, find and click your form, then find your desired field to the right and dbl click that. You should end up with =[form]![your form name]![your field name]. Do the same for all needed fields. You can just type in the above if you know your field names, the builder just helps you out. Open your form, enter some data, then run your query. It should display what is on the form. Once it is all good change it to an append query to the table you want the data in.

    Now go back to your form and open the properties for your save button. Click the "..." and select macro builder.

    Now go create a new macro. first select setwarnings=no, next select open query and set it to the query you just created, then select close and select form and enter your form name. Last select setwarnings=yes. The set warning simply stops you from getting all the "You about to..." messages. Careful if you forget to set it yes it will stop asking you if you want to save things.

    I don't have access on this computer or I'd just build you a sample db. Let me know if you have trouble and I can tommorrow.

  8. #8
    SteveAb is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    4
    Thank you. Due to my beginner skills I am slowly working through the steps you provided. I will let you know if I get stuck on any of your steps.
    Thanks again, Steve

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You could also go to a NewRecord in the OnLoad event of the form:
    DoCmd.RunCommand acCmdRecordsGoToNew

  10. #10
    taya621 is offline Advanced Beginner
    Windows XP Access 2010 64bit
    Join Date
    Jan 2011
    Posts
    38
    Hi RuralGuy,
    Can you tell me how to do the same as mentioned above, create a new blank entry, when I hit a submit button? I have a submit button that I want to save the entry I Was workign on and then immediately create a new blank entry so all my fields are blank. I don't want all users to be able to see other entries.
    Thanks!

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If you set the DataEntry property to YES (on the Data tab of the property sheet) then the form will *only* show you NEW records. The moment you save the record it is not longer NEW and will not be displayed.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-15-2009, 04:46 PM
  2. Replies: 1
    Last Post: 09-05-2008, 12:07 PM
  3. In a field on a Form, on click open another form
    By jackieagra in forum Programming
    Replies: 1
    Last Post: 03-20-2008, 09:44 AM
  4. Form will not open
    By dserbanescu in forum Forms
    Replies: 0
    Last Post: 01-09-2008, 09:48 AM
  5. Open form in another database
    By Karyn-2000 in forum Forms
    Replies: 0
    Last Post: 04-19-2006, 10:17 AM

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